query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Dumps Geometry as GeoJSON | public function toGeoJSON()
{
return Json::encode($this->getGeoInterface());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function write(Geometry $geometry);",
"public function getGeoJson() : string\n {\n return json_encode($this->getGeoJsonArray());\n }",
"public function __toString()\n\t{\n\t\treturn $this->toGeoJSON();\n\t}",
"public function jsonSerialize()\n {\n return new \\GeoJson\\Geometry\\Point($this->getArray());\n }",
"public function json()\n {\n header('Content-Type: application/vnd.geo+json');\n header('Content-Disposition: attachment; filename=\"' . $this->walk . '.geojson\"');\n header(\"Access-Control-Allow-Origin: *\");\n echo $this->getJson();\n exit;\n }",
"public function write(Geometry $geometry) {\n // If geos is installed, then we take a shortcut and let it write the WKT\n if (geoPHP::geosInstalled()) {\n $writer = new GEOSWKTWriter();\n $writer->setTrim(TRUE);\n return $writer->write($geometry->geos());\n }\n \n if ($geometry->isEmpty()) {\n return strtoupper($geometry->geometryType()).' EMPTY';\n }\n else if ($data = $this->extractData($geometry)) {\n return strtoupper($geometry->geometryType()).' ('.$data.')';\n }\n }",
"function get_geo_json($geo_id, $district_id = '') {\n\t\t$return = array ();\n\t\t$return ['layer'] = $this->pbf->render_geo_json ( $geo_id, $district_id );\n\t\t$return ['map'] = $this->pbf->get_center_coords ( $district_id );\n\t\t\n\t\techo json_encode ( $return );\n\t}",
"public function getGeoJsonArray() : array\n {\n return [\n 'type' => 'Feature',\n 'geometry' => [\n 'type' => 'Point',\n 'coordinates' => [$this->longitude, $this->latitude]\n ],\n 'properties' => [\n 'name' => $this->name,\n 'hours_spent' => $this->hoursSpent,\n 'category' => $this->category,\n 'location' => $this->location,\n 'district' => $this->district,\n 'opening_hours' => $this->openingHours\n ]\n ];\n }",
"public function jsonSerialize()\n {\n return $this->toISOZonal($this->jsonSerializePrecision);\n }",
"public function jsonSerialize(){\n\t\t$fields = get_object_vars($this); // do i keep this??\n\t\t$fields = [];\n\t\t$fields[\"lat\"] = $this->pointLatitude;\n\t\t$fields[\"long\"] = $this->pointLongitude;\n\t\treturn($fields);\n\t}",
"public function jsonSerialize(): \\GeoJson\\Geometry\\Polygon\n {\n $linearrings = [];\n foreach ($this->linestrings as $linestring) {\n $linearrings[] = new LinearRing($linestring->jsonSerialize()->getCoordinates());\n }\n\n return new \\GeoJson\\Geometry\\Polygon($linearrings);\n }",
"function get_json_map(){\n\n\t$county = 0;\n\n\t// Build GeoJSON feature collection array\n\t$geojson = array(\n\t 'type' => 'FeatureCollection',\n\t 'features' => array()\n\t);\n\n\t// Request\n\t$args = array(\n\t\t'post_type' => 'evenements',\n\t\t'post_status' => 'publish',\n\t\t'posts_per_page' => -1\n\t);\n\t$query = new WP_Query( $args );\n\tif ( $query->have_posts() ) :\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\t\t// Index\n\t\t\t$county++;\n\t\t\t// Location\n\t\t\t$location = get_field('localisation');\n\t\t\tif( !empty($location) ){\n\t\t\t\t$latitude = $location['lat'];\n\t\t\t\t$longitude = $location['lng'];\n\t\t\t}\n\n\t\t\t$date_start = get_field('date_event');\n\t\t\t$date_end = get_field('date_event_end');\n\t\t\t$hour_start = get_field('hour_event');\n\t\t\t$hour_end = get_field('hour_event_end');\n\n\t\t\t$multidate = ($date_end) ? true : false;\n\t\t\t$multihour = ($hour_end) ? true : false;\n\n\t\t\tif ($multidate) {\n\t\t\t\t$date_output = $date_start.' au '.$date_end;\n\t\t\t} else {\n\t\t\t\t$date_output = $date_start;\n\t\t\t}\n\n\t\t\tif ($multihour) {\n\t\t\t\t$hour_output = $hour_start.' à '.$hour_end;\n\t\t\t} else {\n\t\t\t\t$hour_output = $hour_start;\n\t\t\t}\n\n\t\t\t// Json structure\n\t\t\t$feature = array(\n\t\t 'id' => $county,\n\t\t 'type' => 'Feature', \n\t\t 'geometry' => array(\n\t\t 'type' => 'Point',\n\t\t 'coordinates' => array($longitude, $latitude)\n\t\t ),\n\t\t // Other attribute columns\n\t\t 'properties' => array(\n\t\t 'titre' => '<h2 class=\"bub__title\">' . get_the_title() . '</h2>',\n\t\t 'date' => '<p class=\"bub__date\">' . $date_output . '</p>',\t\t \n\t\t 'permalink' => '<a class=\"bub__button\" href=\"'.get_the_permalink().'\">En savoir plus</a>'\n\t\t )\n\t\t );\n\t\t // Add feature arrays to feature collection array\n\t\t array_push($geojson['features'], $feature);\n\n\t\tendwhile;\n\tendif;\n\t\n\t// Output JSON\n\twp_send_json($geojson);\n\n wp_reset_postdata();\n}",
"public function jsonSerialize()\n {\n $json = array();\n $json['location'] = $this->location;\n $json['astronomy'] = $this->astronomy;\n\n return $json;\n }",
"public function tojson()\n{\n\n return array(\n 'latitude' => $this->getLatitude(),\n 'longitude' => $this->getLongitude(),\n );\n\n}",
"public function toJSON()\n {\n $document = $this->toStdClass();\n return json_encode($document, JSON_FORCE_OBJECT);\n }",
"public function mapToJson()\n {\n // on met en forme pour le JSON\n $temp = array('size' => array('x' => $this->_iBlocXY * $this->_iDimension, 'y' => $this->_iBlocXY * $this->_iDimension),\n 'map' => $this->_aMatrice);\n \n return json_encode($temp);\n }",
"public function geojson($term='Ke'){\n\t\t$geojson = array(\n\t\t 'type' => 'FeatureCollection',\n\t\t 'features' => array()\n\t\t);\n\t\t\n\t\t$dbquery = \\App\\AMP::whereRaw('UPPER(pengelola) LIKE ? ',array(strtoupper('%'.$term.'%')))\n\t\t\t->whereRaw('UPPER(alamat) LIKE ?',array(strtoupper('%'.$term.'%')),'OR')\n\t\t\t->whereRaw('UPPER(merk) LIKE ?',array(strtoupper('%'.$term.'%')),'OR')\n\t\t\t->get();\n\n\t\t# Loop through rows to build feature arrays\n\t\tforeach($dbquery as $k => $v){\n\t\t\t$feature = array(\n\t\t\t\t'id' => $v->ampid,\n\t\t\t\t'type' => 'Feature', \n\t\t\t\t'geometry' => array(\n\t\t\t\t\t'type' => 'Point',\n\t\t\t\t\t# Pass Longitude and Latitude Columns here\n\t\t\t\t\t'coordinates' => array($v->x, $v->y)\n\t\t\t\t),\n\t\t\t\t# Pass other attribute columns here\n\t\t\t\t'properties' => $v\n\t\t\t);\n\t\t\t# Add feature arrays to feature collection array\n\t\t\tarray_push($geojson['features'], $feature);\n\t\t}\n\t\treturn json_encode($geojson, JSON_NUMERIC_CHECK);\n\t\t/*while($row = mysql_fetch_assoc($dbquery)) {\n\t\t\t$feature = array(\n\t\t\t\t'id' => $row['partnership_id'],\n\t\t\t\t'type' => 'Feature', \n\t\t\t\t'geometry' => array(\n\t\t\t\t\t'type' => 'Point',\n\t\t\t\t\t# Pass Longitude and Latitude Columns here\n\t\t\t\t\t'coordinates' => array($row['longitude'], $row['latitude'])\n\t\t\t\t),\n\t\t\t\t# Pass other attribute columns here\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'name' => $row['Name'],\n\t\t\t\t\t'description' => $row['Description'],\n\t\t\t\t\t'sector' => $row['Sector'],\n\t\t\t\t\t'country' => $row['Country'],\n\t\t\t\t\t'status' => $row['Status'],\n\t\t\t\t\t'start_date' => $row['Start Date'],\n\t\t\t\t\t'end_date' => $row['End Date'],\n\t\t\t\t\t'total_invest' => $row['Total Lifetime Investment'],\n\t\t\t\t\t'usg_invest' => $row['USG Investment'],\n\t\t\t\t\t'non_usg_invest' => $row['Non-USG Investment']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t# Add feature arrays to feature collection array\n\t\t\tarray_push($geojson['features'], $feature);\n\t\t}*/\n\t}",
"public function jsonSerialize()\n {\n return array(\n 'id' => $this->getId(),\n 'elementType' => $this->getType(),\n 'position' => array(\n 'x' => $this->getX(),\n 'y' => $this->getY()\n ),\n 'viewData' => array(\n 'rotation' => $this->getRotation(),\n 'shortCut' => array(\n 'title' => $this->getShortCut(),\n 'position' => array(\n 'x' => $this->getShortCutX(),\n 'y' => $this->getShortCutY()\n )\n )\n ),\n 'ports' => $this->getPorts(),\n 'activePoints' => $this->getActivePoints(),\n 'parameters' => $this->getParameters(),\n 'stage' => $this->getStage(),\n 'modelData' => $this->getModel()->jsonSerialize()\n );\n }",
"public function __toString()\n{\n $json = '{\n \"map\": {\n \"geo\": {\n \"lat1\": \"' . $this->lat1 . '\",\n \"lon1\": \"' . $this->lon1 . '\",\n \"lat2\": \"' . $this->lat2 . '\",\n \"lon2\": \"' . $this->lon2 . '\"\n },\n \"distance\": {\n \"miles\": \"' . $this->distanceMiles . '\",\n \"kilometers\": \"' . $this->distanceKilometers . '\"\n }\n }\n }\n\n\n\n ';\n\n if ($this->distanceOnly == true){\n return (string)$this->distanceMiles;\n }\n return $json;\n}",
"public function asJSON();",
"public function export() {\n return $this->geohashes;\n }",
"function sk_update_physician_geojson(){\n\t// init\n\t$docs = array();\n\n\t// get 'em\n\t$physicians = get_posts(array('numberposts' => -1, 'post_type' => 'physician'));\n\n\t// now we need to massage (and fetch) the underlying data\n\tforeach ($physicians as $physician){\n\t\t// this is the most important thing\n\t\t$longlat = sk_get_coords($physician->ID);\n\t\t// bail as early as possible if we don't have actionable location data\n\t\tif (!$longlat){continue;}\n\n\t\t// we'll also pass along some arbitrary properties (note that this is for display AND search)\n\t\t$props = $_specialties = array();\n\n\t\t// name seems reasonable\n\t\t$props['name'] = $physician->post_title;\n\t\t// not ideal...\n\t\t// $props['address'] = sk_hopefully_format_address($physician->ID);\n\n\t\t// get specialties\n\t\t$specialties = get_the_terms($physician->ID, 'specialty');\n\t\tforeach ((array)$specialties as $specialty){\n\t\t\tif (!$specialty){ continue; }\n\t\t\t$_specialties[] = trim(esc_html($specialty->name));\n\t\t}\n\t\tsort($_specialties); // why not?\n\t\t$props['specialties'] = $_specialties;\n\n\t\t// finally, some fields that can all be handled the same\n\t\t$fields = array('state');\n\t\tforeach($fields as $field){\n\t\t\t$props[$field] = get_post_meta($physician->ID, $field, true);\n\t\t}\n\n\t\t// we did it! now make it look like GeoJSON\n\t\t$docs[] = array(\n\t\t\t'type' => 'Feature',\n\t\t\t'id' => $physician->ID,\n\t\t\t'geometry' => array(\n\t\t\t\t'type' => 'Point',\n\t\t\t\t'coordinates' => $longlat\n\t\t\t),\n\t\t\t'properties' => $props,\n\t\t);\n\t}\n\n\t// and write the thing so we can pull it in nice and easy like\n\tfile_put_contents(dirname(__DIR__) . '/physicians.json', json_encode(array('type' => 'FeatureCollection', 'features' => $docs), JSON_NUMERIC_CHECK));\n}",
"public function jsonSerialize()\n {\n $json = array();\n $json['city'] = $this->city;\n $json['state'] = $this->state;\n $json['country'] = $this->country;\n $json['postalCode'] = $this->postalCode;\n $json['addressLine1'] = $this->addressLine1;\n $json['addressLine2'] = $this->addressLine2;\n\n return array_merge($json, $this->additionalProperties);\n }",
"public function getGeoInterface()\n\t{\n\t\t$features = array();\n\n\t\tforeach ($this->features as $feature) {\n\t\t\t$features[] = $feature->getGeoInterface();\n\t\t}\n\n\t\treturn array(\n\t\t\t'type' => 'FeatureCollection',\n\t\t\t'features' => $features\n\t\t);\n\t}",
"public function getGeodata(){\n $all = new UniversityCollection();\n $all->fillFeatures(University::all());\n return json_encode($all);\n }",
"function jsonSerialize();",
"public function extractData($geometry) {\n $parts = array();\n switch ($geometry->geometryType()) {\n case 'Point':\n return $geometry->getX().' '.$geometry->getY();\n case 'LineString':\n foreach ($geometry->getComponents() as $component) {\n $parts[] = $this->extractData($component);\n }\n return implode(', ', $parts);\n case 'Polygon':\n case 'MultiPoint':\n case 'MultiLineString':\n case 'MultiPolygon':\n foreach ($geometry->getComponents() as $component) {\n $parts[] = '('.$this->extractData($component).')';\n }\n return implode(', ', $parts);\n case 'GeometryCollection':\n foreach ($geometry->getComponents() as $component) {\n $parts[] = strtoupper($component->geometryType()).' ('.$this->extractData($component).')';\n }\n return implode(', ', $parts);\n }\n }",
"public function toJSON() {\n return json_encode($this->getData());\n }",
"public function serializeToJsonString() {}",
"public function to_json() {\n\t\t\treturn wp_json_encode( $this->to_array() );\n\t\t}"
] | [
"0.698761",
"0.68057907",
"0.65815884",
"0.6482279",
"0.6281866",
"0.6204437",
"0.59856164",
"0.5628747",
"0.5540866",
"0.53969556",
"0.5371361",
"0.5354396",
"0.5321982",
"0.53151447",
"0.52504176",
"0.5248458",
"0.51923585",
"0.51633525",
"0.5155156",
"0.51503074",
"0.51367474",
"0.513664",
"0.5124474",
"0.5076063",
"0.5031313",
"0.50142705",
"0.5012069",
"0.498212",
"0.4975617",
"0.49696773"
] | 0.7353385 | 0 |
Generate short INN code. | public function shortInnCode(): string
{
return $this->generateInnCode(10);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function longInnCode(): string\n {\n return $this->generateInnCode(12);\n }",
"public function validInnCode(): string\n {\n return $this->generateInnCode();\n }",
"public function getShortCode()\n\t{\n\t\treturn $this->getValue() . $this->getSuit();\n\t}",
"public function invalidInnCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = $this->innCode();\n //Decreases the last digit of the code by 1\n $lastLetter = \\mb_substr($code, -1);\n $code = \\mb_substr($code, 0, -1) . \\abs((int) $lastLetter - 1);\n } else {\n //Gives the wrong length code\n $code = \\mb_substr($this->innCode(), 0, 9);\n }\n\n return $code;\n }",
"function generate(&$code) {}",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"private function generateCode()\n {\n // Generate Code\n $code = random_bytes(config('Pharaonic.short-url.length', 10) / 2);\n $code = bin2hex($code);\n\n // Check Unique Code\n if (!$this->isUniqueCode($code)) return $this->generateCode();\n\n return $code;\n }",
"public function generateCode();",
"public static function printNativeShortCodeDoc()\n {\n $shortCodesDocs = Config::get('short_codes', []);\n\n $template = \"<div class=\\\"table-row table-head\\\"><div class=\\\"table-empty\\\"></div><div class=\\\"shortcodes-name\\\">Name</div><div class=\\\"shortcodes-description\\\">Description</div><div class=\\\"shortcodes-example\\\">Example</div><div class=\\\"table-empty\\\"></div></div>\";\n foreach ($shortCodesDocs as $shortCode => $doc) {\n $template .= \"<div class=\\\"table-row\\\">\n<div class=\\\"table-empty\\\"></div>\n<div class=\\\"shortcodes-name\\\">$shortCode</div><div class=\\\"shortcodes-description\\\">{$doc['description']}</div>\n<div class=\\\"shortcodes-example\\\">{$doc['example']}</div>\n<div class=\\\"table-empty\\\"></div>\n</div>\";\n }\n\n echo $template;\n }",
"function format_code($_code) {\n return substr(format_string(\"<?php \".$_code),7);\n }",
"public function buildPrefix();",
"abstract public function shortName();",
"function generateInvocationCode()\n {\n $conf = $GLOBALS['_MAX']['CONF'];\n $aComments = array(\n 'Cache Buster Comment' => $this->translate(\"\n * Replace all instances of {random} with\n * a generated random number (or timestamp).\n *\"),\n 'Third Party Comment' => $this->translate(\"\n * Don't forget to replace the '{clickurl}' text with\n * the click tracking URL if this ad is to be delivered through a 3rd\n * party (non-Max) adserver.\n *\"),\n 'SSL Delivery Comment' => $this->translate(\"\n * This tag has been generated for use on a non-SSL page. If this tag\n * is to be placed on an SSL page, change the\n * 'http://%s/...'\n * to\n * 'https://%s/...'\n *\", array ($conf['webpath']['delivery'],$conf['webpath']['deliverySSL'])),\n 'SSL Backup Comment' => '',\n );\n if (isset($GLOBALS['layerstyle']) &&\n ($GLOBALS['layerstyle'] == 'geocities' || $GLOBALS['layerstyle'] == 'simple')) {\n $aComments['Comment'] = $this->translate(\"\n *------------------------------------------------------------*\n * This interstitial invocation code requires the images from:\n * /www/images/layerstyles/%s/...\n * To be accessible via: http(s)://%s/layerstyles/%s/...\n *------------------------------------------------------------*\",\n array($GLOBALS['layerstyle'], $conf['webpath']['images'], $GLOBALS['layerstyle']));\n } else {\n $aComments['Comment'] = '';\n }\n\n parent::prepareCommonInvocationData($aComments);\n\n $mi = &$this->maxInvocation;\n $buffer = $mi->buffer;\n\n if(empty($mi->layerstyle)) {\n $mi->layerstyle = PLUGINS_INVOCATIONS_TAGS_ADLAYER_DEFAULT_LAYERSTYLE;\n }\n $invocation = $this->getInvocationLayer($mi->layerstyle);\n if($invocation !== false) {\n $buffer .= $invocation->generateLayerCode($this->maxInvocation).\"\\n\";\n return $buffer;\n } else {\n return false;\n }\n }",
"public function short($input): string\n {\n return $this->engine->short($input);\n }",
"public function generateIndentCode(){\n\t\tglobal $sessionHandler;\n\t\t$year = date('Y');\n\n\t\t$userId = $sessionHandler->getSessionVariable('UserId');\n\n\t\t$makeUserId = \"I\".$userId.\"_\".$year.\"_\";\n\t\t\n\t\t $str=\"SELECT IFNULL(MAX(ABS(SUBSTRING(indentNo,length('\".$makeUserId.\"' ) +1, LENGTH(indentNo) ) ) ),0)+1 AS indentNo FROM inv_indent_master WHERE userId = $userId\";\n\t $uCode=SystemDatabaseManager::getInstance()->executeQuery($str,\"Query: $str\");\n //generate new itemCode code\n\t\t//$gCode=$makeUserId.str_pad($uCode[0]['requisitionNo'],abs(ITEM_CODE_LENGTH-strlen($makeUserId)-strlen($uCode[0]['requisitionNo']))+1,'0',STR_PAD_LEFT);\n\t\t$gCode=$makeUserId.str_pad($uCode[0]['indentNo'],abs(INDENT_CODE_LENGTH-strlen($uCode[0]['indentNo']))+1,'0',STR_PAD_LEFT);\n\t\treturn $gCode;\n }",
"public function toString() {\n\t\treturn sprintf(\"%-40s ; %s || ID %03d CID %03d %s\",$this->getASM(),$this->commentstr,$this->index,$this->codeIndex,$this->getMetaString());\n\t}",
"public function gen($req){\n\t\treturn urlencode($this->_cl_convert($req));\n\t}",
"public function generate()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$return = '<pre>'. specialchars($this->code) .'</pre>';\n\n\t\t\tif ($this->headline != '')\n\t\t\t{\n\t\t\t\t$return = '<'. $this->hl .'>'. $this->headline .'</'. $this->hl .'>'. $return;\n\t\t\t}\n\n\t\t\treturn $return;\n\t\t}\n\n\t\treturn parent::generate();\n\t}",
"public function generateNomor6Seq()\n {\n $config = Config::model()->find(\"nama='toko.kode'\");\n $kodeCabang = $config->nilai;\n $kodeDokumen = KodeDokumen::SO;\n $kodeTahunBulan = date('ym');\n $sequence = substr('00000' . $this->cariNomorTahunan(), -6);\n return \"{$kodeCabang}{$kodeDokumen}{$kodeTahunBulan}{$sequence}\";\n }",
"protected function _generateCode()\n {\n $this->_code = '';\n for ($i = 0; $i < $this->_length; $i++) {\n $this->_code .= substr($this->_characters, mt_rand(0, strlen($this->_characters) - 1), 1);\n }\n }",
"function sciname_short($resultData, $sciname) {\r\n\t// (if genus_designator = \"\"h\"\" or \"\"x\"\", 'x') + /genus_name/ + \"\" \"\"\r\n\t// + (if species_designator = \"\"h\"\" or \"\"x\"\", 'x') + /species_name/\r\n\t// + (if subspecies_name not NULL, ' ssp. ' else \"\" \"\") + /subspecies_name/\r\n\t// + (if variety_name not NULL, ' var. ' else \"\" \"\") + /variety_name/\r\n\t// + (if forma_name not NULL, ' f. ' else \"\" \"\") + /forma_name/\r\n\t// + (if cultivar_name not NULL, space + single quote, else \"\" \"\") + cultivar_name\r\n\t// + (if cultivar_name not NULL, single quote + space) + author_name\r\n\t// + (if plant_patent_no is not NULL plant_patent_no + \"\" \"\" else \"\" \"\") + family_name\r\n\t// + \"\" - \"\" + family_common_name + LINEBREAK\r\n\t// + (if trademark is not NULL {\"\"Trade Names: \"\" + trademark + LINEBREAK})\r\n\t// + (if common_names is not NULL {\"\"Common Names: \"\" + common_names + LINEBREAK})\r\n\t// + (if range is not NULL {\"\"Range: \"\" + range + LINEBREAK)\r\n\t// + (if usda_zone_lo is not NULL {\"\"USDA Hardiness Zone: \"\" + usda_zone_lo + \"\" - \"\" + usda_zone_hi + \"\". \"\"}) \"\r\n\tswitch ($sciname['genus_designator']) {\r\n\t\tcase 'h':\r\n\t\tcase 'x':\r\n\t\t\techo 'x';\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\techo '<b>' . sciname_null($sciname, 'genus_name') . '</b> ';\r\n\t\t\tbreak;\r\n\t}\r\n\tswitch ($sciname['species_designator']) {\r\n\t\tcase 'h':\r\n\t\t\techo '(';\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 'x':\r\n\t\t\techo 'x';\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t}\r\n\techo '<b>' . sciname_null($sciname, 'species_name') . '</b>';\r\n\tswitch ($sciname['species_designator']) {\r\n\t\tcase 'h':\r\n\t\t\techo ') ';\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tdefault:\r\n\t\t\techo ' ';\r\n\t\t\tbreak;\r\n\t}\r\n\tif (!isNull($sciname['subspecies_name'])) {\r\n\t\techo 'ssp. <b>' . $sciname['subspecies_name'] . '</b> ';\r\n\t}\r\n\tif (!isNull($sciname['variety_name'])) {\r\n\t\techo 'var. <b>' . $sciname['variety_name'] . '</b> ';\r\n\t}\r\n\tif (!isNull($sciname['forma_name'])) {\r\n\t\techo 'f. <b>' . $sciname['forma_name'] . '</b> ';\r\n\t}\r\n\tif (!isNull($sciname['cultivar_name'])) {\r\n\t\techo '<b>\\'' . $sciname['cultivar_name'] . '\\' </b>';\r\n\t}\r\n\tif (!isNull($sciname['author_name'])) {\r\n\t\techo '<b>'.$sciname['author_name'] . '</b> ';\r\n\t}\r\n\tif (!isNull($sciname['plant_patent_no'])) {\r\n\t\techo '<b>Plant patent: ' . $sciname['plant_patent_no'] . '</b> ';\r\n\t}\r\n\tif (!isNull($sciname['family_name']) && !isNull($sciname['family_common_name'])) {\r\n\t\techo '<b>'.$sciname['family_name'] . ' — ' . $sciname['family_common_name'] . ' FAMILY </b>';\r\n\t}\r\n\techo '<br />';\r\n\tif (!isNull($sciname['usda_zone_lo'])) {\r\n\t\techo '<b>USDA zone ' . $sciname['usda_zone_lo'];\r\n\t\tif (!isNull($sciname['usda_zone_hi'])) {\r\n\t\t\techo ' - ' . $sciname['usda_zone_hi'];\r\n\t\t}\r\n\t\techo '. </b>';\r\n\t}\r\n\tif (!isNull($sciname['common_names'])) {\r\n\t\techo $sciname['common_names'];\r\n\t}\r\n\tif (!isNull($sciname['trademark'])) {\r\n\t\techo '<b>Trademark Names: ';\r\n\t\t$lastTwoChars = substr($sciname['trademark'], strlen($sciname['trademark']) - 3, 3); \r\n\t\tif ($lastTwoChars == ' T ') {\r\n\t\t\techo substr($sciname['trademark'], 0, strlen($sciname['trademark']) - 3) . '™';\r\n\t\t} elseif ($lastTwoChars == ' R ') {\r\n\t\t\techo substr($sciname['trademark'], 0, strlen($sciname['trademark']) - 3) . '®';\r\n\t\t} else {\r\n\t\t\techo $sciname['trademark'];\r\n\t\t}\r\n\t\techo '</b>';\r\n\t}\r\n}",
"function initShortCode()\n {\n }",
"function walkthrough($WID){\r\n return \"[Diagnosis Info cooming soon]<br /> id is $WID\";\r\n}",
"public function generateCode(): string\n {\n $hashids = new Hashids();\n\n return $hashids->encode($this->id);\n }",
"public function NameLong() {\n\tthrow new exception('2018-04-22 If anything is still calling this, it will need updating.');\n\t$out = $this->Value('Code');\n\t$txtDescr = $this->Value('Descr');\n\tif (!is_null($txtDescr)) {\n\t $out .= ': '.$txtDescr;\n\t}\n\treturn $out;\n }",
"function generateCode($number)\n {\n $out = \"\";\n $codes = \"abcdefghjkmnpqrstuvwxyz23456789ABCDEFGHJKMNPQRSTUVWXYZ\";\n\n while ($number > 53) {\n $key = $number % 54;\n $number = floor($number / 54) - 1;\n $out = $codes{$key} . $out;\n }\n\n return substr($codes{$number} . $out, 1, 6);\n }\n\n /**\n * Validator for generate short url\n * @param $attribute\n * @param $params\n */\n public function generateShort($attribute, $params)\n {\n $this->hash = md5($this->source);\n $this->short = $this->generateCode(hexdec($this->hash));\n while ($this->findByAttributes(array('short' => $this->short))) {\n $this->short = $this->generateCodeRandom();\n }\n }\n\n}",
"private function generatePreamble() {\n $handlerName= $this->getHandlerName();\n \n $preamble= 'private $'.$handlerName.'= null;'.\"\\n\\n\";\n $preamble.= 'public function __construct($handler) {'.\"\\n\".\n ' $this->'.$handlerName.'= $handler;'.\"\\n\".\n \"}\\n\";\n\n return $preamble;\n }",
"protected function _generate($mode)\n {\n if (empty($this->_vars['flags'])) {\n return '';\n }\n\n $flist = array();\n foreach ($this->_vars['flags'] as $flag) {\n $flist[] = '\"' . Ingo_Script_Sieve::escapeString($flag) . '\"';\n }\n\n /* Use string list since it is supported by both imap4flags and\n * imapflags. */\n return $mode . ' [' . implode(', ', $flist) . '];';\n }",
"public function getShortCode()\n {\n return $this->shortCode;\n }",
"function js_template_tools()\n\t{\n\t\treturn \"\n\t\t\t\t<script language='javascript'>\n \t\t\t\tvar template_bit_ids = '<!--IPB.TEMPLATE_BIT_IDS-->';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t}"
] | [
"0.72825843",
"0.657791",
"0.55953544",
"0.5569202",
"0.54373574",
"0.5425723",
"0.54211307",
"0.5388826",
"0.5342958",
"0.5333845",
"0.531773",
"0.5306354",
"0.5304845",
"0.52793956",
"0.52759844",
"0.52516896",
"0.52470076",
"0.5219272",
"0.5202879",
"0.5200231",
"0.5197688",
"0.5196087",
"0.5184445",
"0.51697206",
"0.51686656",
"0.51393545",
"0.5137628",
"0.5125655",
"0.51223487",
"0.5121992"
] | 0.8185667 | 0 |
Generate long INN code. | public function longInnCode(): string
{
return $this->generateInnCode(12);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function shortInnCode(): string\n {\n return $this->generateInnCode(10);\n }",
"public function validInnCode(): string\n {\n return $this->generateInnCode();\n }",
"public function NameLong() {\n\tthrow new exception('2018-04-22 If anything is still calling this, it will need updating.');\n\t$out = $this->Value('Code');\n\t$txtDescr = $this->Value('Descr');\n\tif (!is_null($txtDescr)) {\n\t $out .= ': '.$txtDescr;\n\t}\n\treturn $out;\n }",
"public function invalidInnCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = $this->innCode();\n //Decreases the last digit of the code by 1\n $lastLetter = \\mb_substr($code, -1);\n $code = \\mb_substr($code, 0, -1) . \\abs((int) $lastLetter - 1);\n } else {\n //Gives the wrong length code\n $code = \\mb_substr($this->innCode(), 0, 9);\n }\n\n return $code;\n }",
"function generate(&$code) {}",
"function generateInvocationCode()\n {\n $conf = $GLOBALS['_MAX']['CONF'];\n $aComments = array(\n 'Cache Buster Comment' => $this->translate(\"\n * Replace all instances of {random} with\n * a generated random number (or timestamp).\n *\"),\n 'Third Party Comment' => $this->translate(\"\n * Don't forget to replace the '{clickurl}' text with\n * the click tracking URL if this ad is to be delivered through a 3rd\n * party (non-Max) adserver.\n *\"),\n 'SSL Delivery Comment' => $this->translate(\"\n * This tag has been generated for use on a non-SSL page. If this tag\n * is to be placed on an SSL page, change the\n * 'http://%s/...'\n * to\n * 'https://%s/...'\n *\", array ($conf['webpath']['delivery'],$conf['webpath']['deliverySSL'])),\n 'SSL Backup Comment' => '',\n );\n if (isset($GLOBALS['layerstyle']) &&\n ($GLOBALS['layerstyle'] == 'geocities' || $GLOBALS['layerstyle'] == 'simple')) {\n $aComments['Comment'] = $this->translate(\"\n *------------------------------------------------------------*\n * This interstitial invocation code requires the images from:\n * /www/images/layerstyles/%s/...\n * To be accessible via: http(s)://%s/layerstyles/%s/...\n *------------------------------------------------------------*\",\n array($GLOBALS['layerstyle'], $conf['webpath']['images'], $GLOBALS['layerstyle']));\n } else {\n $aComments['Comment'] = '';\n }\n\n parent::prepareCommonInvocationData($aComments);\n\n $mi = &$this->maxInvocation;\n $buffer = $mi->buffer;\n\n if(empty($mi->layerstyle)) {\n $mi->layerstyle = PLUGINS_INVOCATIONS_TAGS_ADLAYER_DEFAULT_LAYERSTYLE;\n }\n $invocation = $this->getInvocationLayer($mi->layerstyle);\n if($invocation !== false) {\n $buffer .= $invocation->generateLayerCode($this->maxInvocation).\"\\n\";\n return $buffer;\n } else {\n return false;\n }\n }",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"function print_long() {}",
"public function generateIndentCode(){\n\t\tglobal $sessionHandler;\n\t\t$year = date('Y');\n\n\t\t$userId = $sessionHandler->getSessionVariable('UserId');\n\n\t\t$makeUserId = \"I\".$userId.\"_\".$year.\"_\";\n\t\t\n\t\t $str=\"SELECT IFNULL(MAX(ABS(SUBSTRING(indentNo,length('\".$makeUserId.\"' ) +1, LENGTH(indentNo) ) ) ),0)+1 AS indentNo FROM inv_indent_master WHERE userId = $userId\";\n\t $uCode=SystemDatabaseManager::getInstance()->executeQuery($str,\"Query: $str\");\n //generate new itemCode code\n\t\t//$gCode=$makeUserId.str_pad($uCode[0]['requisitionNo'],abs(ITEM_CODE_LENGTH-strlen($makeUserId)-strlen($uCode[0]['requisitionNo']))+1,'0',STR_PAD_LEFT);\n\t\t$gCode=$makeUserId.str_pad($uCode[0]['indentNo'],abs(INDENT_CODE_LENGTH-strlen($uCode[0]['indentNo']))+1,'0',STR_PAD_LEFT);\n\t\treturn $gCode;\n }",
"static function createNewVerificationCode() {\n $uniqueString = uniqid(null, true); //generate a long unique id\n $hashedString = md5($uniqueString); //generate hash\n $finalSubString = substr($hashedString, 0, 20); //save the first 20 characters\n return $finalSubString;\n }",
"abstract public function longName();",
"function generarCodigo($longitud) {\n $key = '';\n $pattern = '1234567890abcdefghijklmnopqrstuwxyz';\n $max = strlen($pattern)-1;\n for ($i=0; $i < $longitud; $i++) $key .= $pattern{mt_rand(0,$max)};\n return $key;\n }",
"public function generateCode();",
"function generarCodigo($longitud) {\n $key = '';\n $pattern = '1234567890abcdefghijklmnopqrstuvwxyz';\n $max = strlen($pattern)-1;\n for($i=0;$i < $longitud;$i++) $key .= $pattern{mt_rand(0,$max)};\n return $key;\n }",
"function js_createLabels() {\n\t\treturn 'WecMap.labels = { startaddress: \"' . $GLOBALS['LANG']->getLL('startaddress') . '\", endaddress: \"' . $GLOBALS['LANG']->getLL('endaddress') . '\" };\nWecMap.locale = \"' . $this->lang . '\";';\n\t}",
"public function generateNomor6Seq()\n {\n $config = Config::model()->find(\"nama='toko.kode'\");\n $kodeCabang = $config->nilai;\n $kodeDokumen = KodeDokumen::SO;\n $kodeTahunBulan = date('ym');\n $sequence = substr('00000' . $this->cariNomorTahunan(), -6);\n return \"{$kodeCabang}{$kodeDokumen}{$kodeTahunBulan}{$sequence}\";\n }",
"protected function _generateCode()\n {\n $this->_code = '';\n for ($i = 0; $i < $this->_length; $i++) {\n $this->_code .= substr($this->_characters, mt_rand(0, strlen($this->_characters) - 1), 1);\n }\n }",
"function generate_code($length = 6) {\n\treturn rand(1001,9999);\n}",
"private function generateCode()\n {\n $this->code = '';\n $len = strlen($this->codeFactor)-1;\n for( $i=0; $i<$this->codeLen; $i++ )\n {\n $this->code .= $this->codeFactor[ mt_rand(0,$len) ];\n }\n }",
"function generate_code_new($length = 6) {\n return mt_rand(1111,9999);\n }",
"function nroDocLong($numero){\n\t\tif(empty($numero))\n\t\t\treturn '000001';\n\t\telse{\n\t\t\t$numero = (int)$numero + 1;\n\t\t\t$longitudNro = (int)strlen($numero);\n\t\t\twhile((6-$longitudNro) > 0){\n\t\t\t\t$numero = '0'.$numero;\n\t\t\t\t++$longitudNro;\n\t\t\t}\n\t\t}\n\t\treturn $numero;\t\n\t}",
"public function generateCode(): string\n {\n $hashids = new Hashids();\n\n return $hashids->encode($this->id);\n }",
"function teen_exc($length) {\n return 40;\n }",
"function js_template_tools()\n\t{\n\t\treturn \"\n\t\t\t\t<script language='javascript'>\n \t\t\t\tvar template_bit_ids = '<!--IPB.TEMPLATE_BIT_IDS-->';\n\t\t\t\t</script>\n\t\t\t\t\";\n\t}",
"function _ocp_profile_generate_line($identifier,$at,$cnt)\n{\n\t$line=$identifier;\n\t$line.='(x'.strval($cnt).')';\n\t$line.=str_repeat(' ',max(1,55-strlen($line))).float_to_raw_string($at['time_length'],4).'s';\n\tif (!is_null($at['specifics'])) $line.=' '.$at['specifics'];\n\treturn $line;\n}",
"public function toString() {\n\t\treturn sprintf(\"%-40s ; %s || ID %03d CID %03d %s\",$this->getASM(),$this->commentstr,$this->index,$this->codeIndex,$this->getMetaString());\n\t}",
"function code_create(){\r\n $code = md5(microtime(true) * time());\r\n $alpha = array('G','H','I','J','K','X','Q','Y','S','M','L','W','N','Z');\r\n\t\t$cut_start = rand(0,(32-$this->code_length));\r\n\t\t$code = substr($code,$cut_start,$this->code_length);\r\n\t\t$code = strtoupper($code);\r\n\t\t// removes Zero and Oh 0 O;\r\n\t\t$code = str_replace('0',$alpha[rand(0,(count($alpha)-1))],$code);\r\n\t\t$code = str_replace('O',rand(1,9),$code);\r\n\t\t$this->code = $code;\r\n\r\n\t}",
"function codDocLong($numero,$nrocifras){\n\t\tif(empty($numero)){\n\t\t\t$num = '1';\n\t\t\twhile(($nrocifras--) > 1){\n\t\t\t\t$num = '0'.$num;\n\t\t\t} \n\t\t\treturn $num;\n\t\t}\n\t\t\t\n\t\telse{\n\t\t\t$numero = (int)$numero + 1;\n\t\t\t$longitudNro = (int)strlen($numero);\n\t\t\twhile(($nrocifras-$longitudNro) > 0){\n\t\t\t\t$numero = '0'.$numero;\n\t\t\t\t++$longitudNro;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $numero;\t\n\t}",
"private static function genCode() {\n\t\t$alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$alpha_digits_len = strlen($alpha_digits) - 1;\n\n\t\t$code = '';\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"function generateLPCCode() {\r\n $code = $this->generateRandomString(32, \"BT-\");\r\n return $code;\r\n }"
] | [
"0.7402651",
"0.63121504",
"0.58385646",
"0.570113",
"0.5484791",
"0.5452589",
"0.5442573",
"0.5419139",
"0.53730977",
"0.5372637",
"0.53513414",
"0.53123724",
"0.5308005",
"0.5281558",
"0.51898724",
"0.51670575",
"0.5160314",
"0.5158714",
"0.5134976",
"0.5134256",
"0.5115552",
"0.5083213",
"0.5078351",
"0.507051",
"0.5039053",
"0.50014216",
"0.5000927",
"0.49962428",
"0.49924058",
"0.49896225"
] | 0.7983092 | 0 |
Generate valid INN code. | public function validInnCode(): string
{
return $this->generateInnCode();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function invalidInnCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = $this->innCode();\n //Decreases the last digit of the code by 1\n $lastLetter = \\mb_substr($code, -1);\n $code = \\mb_substr($code, 0, -1) . \\abs((int) $lastLetter - 1);\n } else {\n //Gives the wrong length code\n $code = \\mb_substr($this->innCode(), 0, 9);\n }\n\n return $code;\n }",
"public function shortInnCode(): string\n {\n return $this->generateInnCode(10);\n }",
"public function longInnCode(): string\n {\n return $this->generateInnCode(12);\n }",
"public function generateCode();",
"function generate(&$code) {}",
"protected function generateVerifyCode()\n {\n if ($this->minLength > $this->maxLength) {\n $this->maxLength = $this->minLength;\n }\n if ($this->minLength < 3) {\n $this->minLength = 3;\n }\n if ($this->maxLength > 20) {\n $this->maxLength = 20;\n }\n $length = mt_rand($this->minLength, $this->maxLength);\n \n $letters = 'bcdfghjklmnpqrstvwxyz';\n $vowels = 'aeiou';\n $code = '';\n for ($i = 0; $i < $length; ++$i) {\n if ($i % 2 && mt_rand(0, 10) > 2 || !($i % 2) && mt_rand(0, 10) > 9) {\n $code .= $vowels[mt_rand(0, 4)];\n } else { \n $code .= $letters[mt_rand(0, 20)];\n } \n } \n \n return $code;\n }",
"public function generateVerifyCode()\n\t{\n\t\tif($this->minLength < 3)\n\t\t\t$this->minLength = 3;\n\t\tif($this->maxLength > 20)\n\t\t\t$this->maxLength = 20;\n\t\tif($this->minLength > $this->maxLength)\n\t\t\t$this->maxLength = $this->minLength;\n\t\t$length = mt_rand($this->minLength,$this->maxLength);\n\n\t\t$letters = 'bcdfghjklmnpqrstvwxyz';\n\t\t$vowels = 'aeiou';\n\t\t$numbers = '1234567890';\n\t\t$code = '';\n\t\tfor($i = 0; $i < $length; ++$i)\n\t\t{\n\t\t\tif($i % 2 && mt_rand(0,10) > 2 || !($i % 2) && mt_rand(0,10) > 9)\n\t\t\t\t$code.=$vowels[mt_rand(0,4)];\n\t\t\telse\n\t\t\t\t$code.=$letters[mt_rand(0,20)];\n if($i == $length / 2 || mt_rand(0,7) > $length / 2)\n $code.=$numbers[mt_rand(0,9)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"public function invalidKppCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = static::toLower(static::bothify('#######??'));\n } else {\n $code = \\mb_substr($this->kppCode(), 0, 8);\n }\n\n return $code;\n }",
"function process_input(&$ns, $unused = false) {\n $this->rule['type'] = 13;\n if(!isset($ns['customrule'])){\n $this->errmsg = _(\"Please enter a valid Sieve code snippet.\");\n } else {\n $code = trim($ns['customrule']);\n }\n\n if(!empty($code)) {\n $this->rule['code'] = $code;\n } else {\n $this->rule['code'] = '';\n $this->errmsg = _(\"Please enter a valid Sieve code snippet.\");\n }\n }",
"protected function _createCode()\n {\n $chars = array ('A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'I', 'J', 'K', 'L', 'M', 'N', '0', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');\n $code = '';\n for ($i = 0; $i < self::CODE_LENGTH; $i++) {\n $code .= $chars[rand(0, count($chars) - 1)];\n }\n return $code;\n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"public function validKppCode(): string\n {\n return static::toUpper(static::bothify('####??###'));\n }",
"private function _generate_verification_code()\n {\n $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZzxcvbnmasdfghjklqwertyuiop';\n\n $pin = mt_rand(10, 9999) . mt_rand(10, 9999) . $characters[rand(0, strlen($characters) - 1)];\n\n return str_shuffle($pin);\n }",
"public function code(): string;",
"private function generateCode()\n {\n $this->code = '';\n $len = strlen($this->codeFactor)-1;\n for( $i=0; $i<$this->codeLen; $i++ )\n {\n $this->code .= $this->codeFactor[ mt_rand(0,$len) ];\n }\n }",
"function code_create(){\r\n $code = md5(microtime(true) * time());\r\n $alpha = array('G','H','I','J','K','X','Q','Y','S','M','L','W','N','Z');\r\n\t\t$cut_start = rand(0,(32-$this->code_length));\r\n\t\t$code = substr($code,$cut_start,$this->code_length);\r\n\t\t$code = strtoupper($code);\r\n\t\t// removes Zero and Oh 0 O;\r\n\t\t$code = str_replace('0',$alpha[rand(0,(count($alpha)-1))],$code);\r\n\t\t$code = str_replace('O',rand(1,9),$code);\r\n\t\t$this->code = $code;\r\n\r\n\t}",
"static function generateVerificationCode()\n {\n $codeSize = 16;\n\n // Generate the entropy with PHP's pseudo-random bytes generator function.\n $numBytes = floor($codeSize / 2);\n $randInt = openssl_random_pseudo_bytes($numBytes);\n\n return strtoupper(bin2hex($randInt));\n }",
"private static function genCode() {\n\t\t$alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$alpha_digits_len = strlen($alpha_digits) - 1;\n\n\t\t$code = '';\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"protected function _generateCode()\n {\n $this->_code = '';\n for ($i = 0; $i < $this->_length; $i++) {\n $this->_code .= substr($this->_characters, mt_rand(0, strlen($this->_characters) - 1), 1);\n }\n }",
"protected function parseTransactionCode()\n {\n return '000';\n }",
"public function createVerificationCode(): string\n {\n $this->update(['verification_code' => str_random(40)]);\n return $this->verification_code;\n }",
"static function createNewVerificationCode() {\n $uniqueString = uniqid(null, true); //generate a long unique id\n $hashedString = md5($uniqueString); //generate hash\n $finalSubString = substr($hashedString, 0, 20); //save the first 20 characters\n return $finalSubString;\n }",
"public function createCode() {\r\n $activatecode = '';\r\n $base = 'ABCDEFGHKLMNOPQRSTWXYZabcdefghjkmnpqrstwxyz0123456789';\r\n $len = 6;\r\n $max = strlen($base) - 1;\r\n\r\n mt_srand((double) microtime() * 1000000);\r\n\r\n while (strlen($activatecode) < $len + 1){\r\n $activatecode.=$base{mt_rand(0, $max)};\r\n }\r\n return $activatecode;\r\n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code\t\t= \"\";\n\t\t$Alphabet \t= \"ABCEGHKLMNOPQRSUXYZ\";\n\t\t$Number \t= '1234567890';\n\t\t/* First two Alphabets. */\n\t\t$count = strlen($Alphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\t\t\n\t\t/* Next six numbers */\n\t\t$count = strlen($Number) - 1;\n\t\t\n\t\tfor($i=0;$i<4;$i++){\n\t\t\t$code .= $Number[rand(0,$count)];\n\t\t}\t\t\n\t\t/* Last alphabet. */\n\t\t$count = strlen($Alphabet) - 1;\n\t\tfor($i=0;$i<2;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$itemCheck = $this->getCode($code);\n\n\t\tif($itemCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"public function generateCode()\n {\n $v = array(\"a\", \"e\", \"i\", \"o\", \"u\", \"ou\", \"ie\", \"ee\", \"ei\", \"ao\");\n $c = array(\"b\", \"bl\", \"br\", \"c\", \"ch\", \"cl\", \"d\", \"dh\", \"f\", \"fh\", \"g\", \"gh\", \"h\", \"j\", \"k\", \"kr\", \"kl\", \"l\", \"m\", \"mn\", \"mp\", \"n\", \"np\", \"p\", \"pp\", \"qu\", \"r\", \"s\", \"sh\", \"sch\", \"st\", \"t\", \"th\", \"thr\", \"tt\", \"v\", \"w\", \"xy\", \"y\", \"z\");\n $this->code = \"\";\n for ($i = 0; $i < $this->stringLength; $i++) {\n //$this->code .= chr(rand(97,122));\n $this->code .= $c[rand(0, count($c)-1)] . $v[rand(0, count($v)-1)];\n }\n $this->code = strtoupper(substr($this->code, 0, 1)) . substr($this->code, 1, $this->stringLength-1);\n $this->saveToSession();\n }",
"public function genererCode(){\n include('ConnectionBD.php');\n $this->CodeB = \"BEN-\" . rand(100000, 999999); \n while($this->verifierCode($this->CodeB)==1){\n $this->codeB = \"BEN-\" . rand(100000, 999999); \n }\n \n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code \t\t= \"\";\n\t\t$Alphabet\t= \"ABCEGHKMNOPQRSUXZ\";\n\t\t$Number \t= '23456789';\n\t\t\n\t\t$count = strlen($Number) - 1;\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$code .= $Number[rand(0,$count)];\n\t\t}\n\t\t$count = strlen($Alphabet) - 1;\n\t\tfor($i=0;$i<2;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\t\t\n\t\t/* First check if it exists or not. */\n\t\t$itemCheck = $this->getCode($code);\n\t\tif($itemCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"public function createCode() {\t\t\r\n\t\t$code_feed = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyv0123456789\";\r\n\t\t$code_length = 10; // Set this to be your desired code length\r\n\t\t$final_code = \"\";\r\n\t\t$feed_length = strlen($code_feed);\r\n\t\t\r\n\t\tfor($i = 0; $i < $code_length; $i ++) {\r\n\t\t $feed_selector = rand(0,$feed_length-1);\r\n\t\t $final_code .= substr($code_feed,$feed_selector,1);\r\n\t\t}\r\n\r\n\t $hash = sha1($final_code); // hash data with sha1\r\n\t $hash2 = substr($hash, 0, 10); // grab first 10 digits\r\n\t $hash3 = strtoupper($hash2); // force uppercase of all values\r\n\t return $hash3; // force uppercase of all values\r\n\t}",
"function generateVerificationCode()\n{\n $codeSize = 16;\n\n // Generate the entropy with PHP's pseudo-random bytes generator function\n $numBytes = floor($codeSize / 2);\n $randInt = openssl_random_pseudo_bytes($numBytes);\n\n return strtoupper(bin2hex($randInt));\n}"
] | [
"0.72175413",
"0.6769471",
"0.6571881",
"0.58026356",
"0.57089174",
"0.5708263",
"0.5679148",
"0.56268185",
"0.5608098",
"0.5527743",
"0.5509684",
"0.5498523",
"0.5494132",
"0.54462487",
"0.54116195",
"0.53719443",
"0.5368098",
"0.53508097",
"0.5326932",
"0.52610844",
"0.5242478",
"0.522397",
"0.5219409",
"0.51662457",
"0.51635706",
"0.51446867",
"0.5143501",
"0.5142206",
"0.5141252",
"0.51201344"
] | 0.82378125 | 0 |
Generate invalid INN code. | public function invalidInnCode(): string
{
if (Miscellaneous::boolean()) {
$code = $this->innCode();
//Decreases the last digit of the code by 1
$lastLetter = \mb_substr($code, -1);
$code = \mb_substr($code, 0, -1) . \abs((int) $lastLetter - 1);
} else {
//Gives the wrong length code
$code = \mb_substr($this->innCode(), 0, 9);
}
return $code;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validInnCode(): string\n {\n return $this->generateInnCode();\n }",
"public function invalidKppCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = static::toLower(static::bothify('#######??'));\n } else {\n $code = \\mb_substr($this->kppCode(), 0, 8);\n }\n\n return $code;\n }",
"public function longInnCode(): string\n {\n return $this->generateInnCode(12);\n }",
"public function shortInnCode(): string\n {\n return $this->generateInnCode(10);\n }",
"public function testOtherInvalidIsbn()\n {\n $this->expectException(\"Exception\");\n $this->expectExceptionMessage(\"Invalid characters in the code\");\n\n Isbn::validateAsIsbn13(\"34995031X\");\n }",
"protected function parseTransactionCode()\n {\n return '000';\n }",
"public function invalidNricDataProvider()\n {\n $nrics = [\n ['811402', '08', '1110'],\n ['811231', 'aa', '1110'],\n ['120228', '08', 'aaaa'],\n ];\n\n foreach ($nrics as $nric) {\n yield [\n \\implode('', $nric),\n \\implode('-', $nric),\n ];\n }\n }",
"public function testInvalidFunctionCodeParse()\n {\n //81 80 + 00 00 + 00 05 + 03 + 11 + 00 01 + 00 0A\n $data = \"\\x81\\x80\\x00\\x00\\x00\\x06\\x03\\x11\\x00\\x01\\x00\\x0A\";\n\n /** @var ErrorResponse $response */\n $response = RequestFactory::parseRequest($data);\n self::assertInstanceOf(ErrorResponse::class, $response);\n self::assertEquals(1, $response->getErrorCode());\n }",
"public function validKppCode(): string\n {\n return static::toUpper(static::bothify('####??###'));\n }",
"protected function generateVerifyCode()\n {\n if ($this->minLength > $this->maxLength) {\n $this->maxLength = $this->minLength;\n }\n if ($this->minLength < 3) {\n $this->minLength = 3;\n }\n if ($this->maxLength > 20) {\n $this->maxLength = 20;\n }\n $length = mt_rand($this->minLength, $this->maxLength);\n \n $letters = 'bcdfghjklmnpqrstvwxyz';\n $vowels = 'aeiou';\n $code = '';\n for ($i = 0; $i < $length; ++$i) {\n if ($i % 2 && mt_rand(0, 10) > 2 || !($i % 2) && mt_rand(0, 10) > 9) {\n $code .= $vowels[mt_rand(0, 4)];\n } else { \n $code .= $letters[mt_rand(0, 20)];\n } \n } \n \n return $code;\n }",
"public function generateVerifyCode()\n\t{\n\t\tif($this->minLength < 3)\n\t\t\t$this->minLength = 3;\n\t\tif($this->maxLength > 20)\n\t\t\t$this->maxLength = 20;\n\t\tif($this->minLength > $this->maxLength)\n\t\t\t$this->maxLength = $this->minLength;\n\t\t$length = mt_rand($this->minLength,$this->maxLength);\n\n\t\t$letters = 'bcdfghjklmnpqrstvwxyz';\n\t\t$vowels = 'aeiou';\n\t\t$numbers = '1234567890';\n\t\t$code = '';\n\t\tfor($i = 0; $i < $length; ++$i)\n\t\t{\n\t\t\tif($i % 2 && mt_rand(0,10) > 2 || !($i % 2) && mt_rand(0,10) > 9)\n\t\t\t\t$code.=$vowels[mt_rand(0,4)];\n\t\t\telse\n\t\t\t\t$code.=$letters[mt_rand(0,20)];\n if($i == $length / 2 || mt_rand(0,7) > $length / 2)\n $code.=$numbers[mt_rand(0,9)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"function generate(&$code) {}",
"private function generateCode()\n {\n $this->code = '';\n $len = strlen($this->codeFactor)-1;\n for( $i=0; $i<$this->codeLen; $i++ )\n {\n $this->code .= $this->codeFactor[ mt_rand(0,$len) ];\n }\n }",
"public function testValueInvalidchars() {\n $this->assertEquals('VALIDATION.STRING_CONTAINS_INVALID_CHARACTERS', $this->getValidator()->validate('*ASDASD123456')[0]['__CODE'] );\n }",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"public function HiddenEmailAddress()\n {\n $originalString = $this->value;\n $encodedString = '';\n $nowCodeString = '';\n $originalLength = strlen($this->value);\n for ($i = 0; $i < $originalLength; ++$i) {\n $encodeMode = rand(1, 2); // Switch encoding odd/even\n switch ($encodeMode) {\n case 1: // Decimal code\n $nowCodeString = '&#'.ord($originalString[$i]).';';\n break;\n case 2: // Hexadecimal code\n $nowCodeString = '&#x'.dechex(ord($originalString[$i])).';';\n break;\n default:\n return 'ERROR: wrong encoding mode.';\n }\n $encodedString .= $nowCodeString;\n }\n\n return $encodedString;\n }",
"function generateInvalidPhoneNumber() {\r\n\t\t$phoneNumber = (string) mt_rand(0, 1);\r\n\r\n\t\t// Add nine other digits.\r\n\t\tfor ( $i = 0; $i < 9; $i++ ) {\r\n\t\t\t$phoneNumber .= mt_rand(0, 9);\r\n\t\t}\r\n\r\n\t\treturn $phoneNumber;\r\n\r\n\t}",
"protected function _createCode()\n {\n $chars = array ('A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'I', 'J', 'K', 'L', 'M', 'N', '0', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');\n $code = '';\n for ($i = 0; $i < self::CODE_LENGTH; $i++) {\n $code .= $chars[rand(0, count($chars) - 1)];\n }\n return $code;\n }",
"public function message()\n {\n return 'The registration code is invalid.';\n }",
"public function testParseInvalidValue()\n {\n new IRI(2);\n }",
"private function _generate_verification_code()\n {\n $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZzxcvbnmasdfghjklqwertyuiop';\n\n $pin = mt_rand(10, 9999) . mt_rand(10, 9999) . $characters[rand(0, strlen($characters) - 1)];\n\n return str_shuffle($pin);\n }",
"public function generateErrorCode () {\n\t\t\treturn $this->resourceIdentifier + $this->generateErrorCodeOnThisLevel();\n\t\t}",
"public function message()\n {\n return 'The field contains an invalid ISBN format.';\n }",
"static function generateVerificationCode()\n {\n $codeSize = 16;\n\n // Generate the entropy with PHP's pseudo-random bytes generator function.\n $numBytes = floor($codeSize / 2);\n $randInt = openssl_random_pseudo_bytes($numBytes);\n\n return strtoupper(bin2hex($randInt));\n }",
"public function testInvalidCurrencyCode()\n {\n $this->setExpectedException('NostoInvalidArgumentException');\n\n new NostoCurrencyCode('eur');\n }",
"public function getIdentifier(): string\n {\n return sprintf('not(<%s>)', $this->validator->getIdentifier());\n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code \t\t= \"\";\n\t\t$Alphabet\t= \"ABCEGHKMNOPQRSUXZ\";\n\t\t$Number \t= '23456789';\n\t\t\n\t\t$count = strlen($Number) - 1;\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$code .= $Number[rand(0,$count)];\n\t\t}\n\t\t$count = strlen($Alphabet) - 1;\n\t\tfor($i=0;$i<2;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\t\t\n\t\t/* First check if it exists or not. */\n\t\t$itemCheck = $this->getCode($code);\n\t\tif($itemCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"public function code(): string;",
"public function message() : string\n {\n return $this->getLocalizedErrorMessage(\n 'country_code',\n 'The :attribute must be a valid ISO 3166-1 alpha-' . ($this->parameters[0] ?? 2) . ' country code'\n );\n }"
] | [
"0.7863758",
"0.6424929",
"0.6144914",
"0.60618484",
"0.56559944",
"0.5617085",
"0.5551926",
"0.54492366",
"0.54251343",
"0.5394298",
"0.5363287",
"0.5359237",
"0.5358895",
"0.5356607",
"0.5350626",
"0.53443086",
"0.53434503",
"0.53371507",
"0.5332336",
"0.52943",
"0.5288785",
"0.5277641",
"0.52752763",
"0.5266514",
"0.52516824",
"0.52456534",
"0.52374196",
"0.52283317",
"0.5227268",
"0.52184635"
] | 0.8029781 | 0 |
Generate valid KPP code. | public function validKppCode(): string
{
return static::toUpper(static::bothify('####??###'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function invalidKppCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = static::toLower(static::bothify('#######??'));\n } else {\n $code = \\mb_substr($this->kppCode(), 0, 8);\n }\n\n return $code;\n }",
"public function generateCode();",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"function generate(&$code) {}",
"private function generateCode()\n {\n $this->code = '';\n $len = strlen($this->codeFactor)-1;\n for( $i=0; $i<$this->codeLen; $i++ )\n {\n $this->code .= $this->codeFactor[ mt_rand(0,$len) ];\n }\n }",
"public function validInnCode(): string\n {\n return $this->generateInnCode();\n }",
"public function generate() {\n\t\tif ($_POST) {\n\t\t\t// Valid input.\n\t\t\t$this->validInput ();\n\t\t\tif ($this->hasErrors ()) {\n\t\t\t\treturn \"success\";\n\t\t\t}\n\t\t\t$this->generateInterfaces ();\n\t\t\t// Add action message.\n\t\t\t$this->addActionMessage ( \"Code was generated successfull.\" );\n\t\t}\n\t\treturn \"success\";\n\t}",
"public function generateVerifyCode()\n\t{\n\t\tif($this->minLength < 3)\n\t\t\t$this->minLength = 3;\n\t\tif($this->maxLength > 20)\n\t\t\t$this->maxLength = 20;\n\t\tif($this->minLength > $this->maxLength)\n\t\t\t$this->maxLength = $this->minLength;\n\t\t$length = mt_rand($this->minLength,$this->maxLength);\n\n\t\t$letters = 'bcdfghjklmnpqrstvwxyz';\n\t\t$vowels = 'aeiou';\n\t\t$numbers = '1234567890';\n\t\t$code = '';\n\t\tfor($i = 0; $i < $length; ++$i)\n\t\t{\n\t\t\tif($i % 2 && mt_rand(0,10) > 2 || !($i % 2) && mt_rand(0,10) > 9)\n\t\t\t\t$code.=$vowels[mt_rand(0,4)];\n\t\t\telse\n\t\t\t\t$code.=$letters[mt_rand(0,20)];\n if($i == $length / 2 || mt_rand(0,7) > $length / 2)\n $code.=$numbers[mt_rand(0,9)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"function code_create(){\r\n $code = md5(microtime(true) * time());\r\n $alpha = array('G','H','I','J','K','X','Q','Y','S','M','L','W','N','Z');\r\n\t\t$cut_start = rand(0,(32-$this->code_length));\r\n\t\t$code = substr($code,$cut_start,$this->code_length);\r\n\t\t$code = strtoupper($code);\r\n\t\t// removes Zero and Oh 0 O;\r\n\t\t$code = str_replace('0',$alpha[rand(0,(count($alpha)-1))],$code);\r\n\t\t$code = str_replace('O',rand(1,9),$code);\r\n\t\t$this->code = $code;\r\n\r\n\t}",
"public function generateCode()\n {\n $v = array(\"a\", \"e\", \"i\", \"o\", \"u\", \"ou\", \"ie\", \"ee\", \"ei\", \"ao\");\n $c = array(\"b\", \"bl\", \"br\", \"c\", \"ch\", \"cl\", \"d\", \"dh\", \"f\", \"fh\", \"g\", \"gh\", \"h\", \"j\", \"k\", \"kr\", \"kl\", \"l\", \"m\", \"mn\", \"mp\", \"n\", \"np\", \"p\", \"pp\", \"qu\", \"r\", \"s\", \"sh\", \"sch\", \"st\", \"t\", \"th\", \"thr\", \"tt\", \"v\", \"w\", \"xy\", \"y\", \"z\");\n $this->code = \"\";\n for ($i = 0; $i < $this->stringLength; $i++) {\n //$this->code .= chr(rand(97,122));\n $this->code .= $c[rand(0, count($c)-1)] . $v[rand(0, count($v)-1)];\n }\n $this->code = strtoupper(substr($this->code, 0, 1)) . substr($this->code, 1, $this->stringLength-1);\n $this->saveToSession();\n }",
"public static function genCnpjValid() {\n $n1 = rand(0, 9);\n $n2 = rand(0, 9);\n $n3 = rand(0, 9);\n $n4 = rand(0, 9);\n $n5 = rand(0, 9);\n $n6 = rand(0, 9);\n $n7 = rand(0, 9);\n $n8 = rand(0, 9);\n $n9 = 0;\n $n10 = 0;\n $n11 = 0;\n $n12 = 1;\n $d1 = $n12 * 2 + $n11 * 3 + $n10 * 4 + $n9 * 5 + $n8 * 6 + $n7 * 7 + $n6 * 8 + $n5 * 9 + $n4 * 2 + $n3 * 3 + $n2 * 4 + $n1 * 5;\n $d1 = 11 - (self::mod($d1, 11) );\n if ($d1 >= 10) {\n $d1 = 0;\n }\n $d2 = $d1 * 2 + $n12 * 3 + $n11 * 4 + $n10 * 5 + $n9 * 6 + $n8 * 7 + $n7 * 8 + $n6 * 9 + $n5 * 2 + $n4 * 3 + $n3 * 4 + $n2 * 5 + $n1 * 6;\n $d2 = 11 - (self::mod($d2, 11) );\n if ($d2 >= 10) {\n $d2 = 0;\n }\n $cnpj = '' . $n1 . $n2 . $n3 . $n4 . $n5 . $n6 . $n7 . $n8 . $n9 . $n10 . $n11 . $n12 . $d1 . $d2;\n return $cnpj;\n }",
"Public function generateCode()\n {\n\t\t\t$generator = new Grazitti_Promotions_Model_Massgenerator();\n\t\t\t$days = Mage::getStoreConfig('grazitti/general/days');\n\t\t\t$currentdate = new Zend_Date(Mage::getModel('core/date')->timestamp());\n\t\t\t$currentdate->addDay($days);\n\t\t\t$currentdate->toString('Y-m-d H:i:s'); //Returns representation of date \n\t\t\t$ruleId = Mage::getStoreConfig('grazitti/general/rules');\n\t\t\t\n\t\t\t$data = array(\n\t\t\t'max_probability' => .25,\n\t\t\t'max_attempts' => 10,\n\t\t\t'uses_per_customer' => 1,\n\t\t\t'uses_per_coupon' => 1,\n\t\t\t'qty' => 1, //number of coupons to generate\n\t\t\t'length' => 14, //length of coupon string\n\t\t\t'to_date' => $currentdate, //ending date of generated promo\n\t\t\t'format' => Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC,\n\t\t\t'rule_id' => $ruleId //the id of the rule you will use as a template\n\t\t);\n\t\t\t$generator->validateData($data);\n\t\t\t$generator->setData($data);\n\t\t\t$couponCode = $generator->generatePool(); \n\t\t\treturn $couponCode;\n\t}",
"protected function _generateCode()\n {\n $this->_code = '';\n for ($i = 0; $i < $this->_length; $i++) {\n $this->_code .= substr($this->_characters, mt_rand(0, strlen($this->_characters) - 1), 1);\n }\n }",
"protected function generateVerifyCode()\n {\n if ($this->minLength > $this->maxLength) {\n $this->maxLength = $this->minLength;\n }\n if ($this->minLength < 3) {\n $this->minLength = 3;\n }\n if ($this->maxLength > 20) {\n $this->maxLength = 20;\n }\n $length = mt_rand($this->minLength, $this->maxLength);\n \n $letters = 'bcdfghjklmnpqrstvwxyz';\n $vowels = 'aeiou';\n $code = '';\n for ($i = 0; $i < $length; ++$i) {\n if ($i % 2 && mt_rand(0, 10) > 2 || !($i % 2) && mt_rand(0, 10) > 9) {\n $code .= $vowels[mt_rand(0, 4)];\n } else { \n $code .= $letters[mt_rand(0, 20)];\n } \n } \n \n return $code;\n }",
"public function genCpfValid(){\n $n1 = rand(0, 9);\n $n2 = rand(0, 9);\n $n3 = rand(0, 9);\n $n4 = rand(0, 9);\n $n5 = rand(0, 9);\n $n6 = rand(0, 9);\n $n7 = rand(0, 9);\n $n8 = rand(0, 9);\n $n9 = rand(0, 9);\n $d1 = $n9 * 2 + $n8 * 3 + $n7 * 4 + $n6 * 5 + $n5 * 6 + $n4 * 7 + $n3 * 8 + $n2 * 9 + $n1 * 10;\n $d1 = 11 - (self::mod($d1, 11) );\n if ($d1 >= 10) {\n $d1 = 0;\n }\n $d2 = $d1 * 2 + $n9 * 3 + $n8 * 4 + $n7 * 5 + $n6 * 6 + $n5 * 7 + $n4 * 8 + $n3 * 9 + $n2 * 10 + $n1 * 11;\n $d2 = 11 - (self::mod($d2, 11) );\n if ($d2 >= 10) {\n $d2 = 0;\n }\n $cpf = '' . $n1 . $n2 . $n3 . $n4 . $n5 . $n6 . $n7 . $n8 . $n9 . $d1 . $d2;\n return $cpf;\n }",
"private static function genCode() {\n\t\t$alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$alpha_digits_len = strlen($alpha_digits) - 1;\n\n\t\t$code = '';\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"protected function _createCode()\n {\n $chars = array ('A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'I', 'J', 'K', 'L', 'M', 'N', '0', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');\n $code = '';\n for ($i = 0; $i < self::CODE_LENGTH; $i++) {\n $code .= $chars[rand(0, count($chars) - 1)];\n }\n return $code;\n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"private function _generate_verification_code()\n {\n $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZzxcvbnmasdfghjklqwertyuiop';\n\n $pin = mt_rand(10, 9999) . mt_rand(10, 9999) . $characters[rand(0, strlen($characters) - 1)];\n\n return str_shuffle($pin);\n }",
"public function generateCode()\n {\n $this->code = str_random(32);\n }",
"public function createCode()\n {\n\t\ttry{\n\t\t\t$datetime= date('Y-m-d H:i:s');\n\t\t\t$string_1 = \"\";\n\t\t\t$chars = \"AB1CD2EF3GH4IJ5KL6MN7OP8QR9ST0UVWXYZabcdefghijklmnopqrstuvwxyz\";\n\t\t\tfor($k=0;$k<10;$k++)\n\t\t\t$string_1.=substr($chars,rand(0,strlen($chars)),1);\n\t\t\t\n\t\t\t$string_f=substr($string_1,-1).substr(md5($datetime .$string_1.substr($string_1,1)),-5) ;\n\t\t\treturn $string_f;\n\t\t}\n\t\t\tcatch(\\Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function run()\n\t{\n\t\t$faker = Faker::create();\n\n\t\t$kpis = [\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_2g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_2g_2',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c3+c5',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_2g_3',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1*2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_3g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1+c9',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_3g_2',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c5*2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_4g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c10+c5',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'partial_eri_4g_2',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1*10',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'partial_hua_2g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1*2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'partial_hua_3g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1+c2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'partial_hua_4g_1',\n\t\t\t\t'type' => 'prt',\n\t\t\t\t'equation' => 'c1+c2+c3',\n\t\t\t],\n\n\t\t\t// ****************************************************\n\t\t\t// ****************************************************\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'dual_eri_2g_3g_1',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p1+p4',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'dual_eri_2g_3g_2',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p2*+p5',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'dual_eri_3g_4g_1',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p4+p6',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'dual_hua_2g_3g_1',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p8+p9',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'multi_eri_1',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p1+p4+p6',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => null,\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'multi_hua_1',\n\t\t\t\t'type' => 'tech',\n\t\t\t\t'equation' => 'p8+p9+p10',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => null,\n\t\t\t\t'name' => 'vendor_2g',\n\t\t\t\t'type' => 'vnd',\n\t\t\t\t'equation' => '100*(p1+p8)/(p2)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => null,\n\t\t\t\t'name' => 'vendor_3g',\n\t\t\t\t'type' => 'vnd',\n\t\t\t\t'equation' => 'p4+p9/p5',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => null,\n\t\t\t\t'name' => 'vendor_4g',\n\t\t\t\t'type' => 'vnd',\n\t\t\t\t'equation' => 'p6+p10',\n\t\t\t],\n\n\t\t\t// ****************************************************\n\t\t\t// ****************************************************\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'cssr_cs',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c1+p2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'cdr',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(3*c2)-c7',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'sd_drop',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => '2*(c3+c1)',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'calls',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => '(3*c32-c70)+c50',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'cdr',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c1*2',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'tch_block',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(2*c2)-c7',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '2g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'th',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(3*c10)-c7',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'tch_block',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c1+c50',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'cdr',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(3*c2)-c7',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '3g',\n\t\t\t\t'vendor' => 'hua',\n\t\t\t\t'name' => 'th',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(3*c10)-c7',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'tch_block',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c1+c33',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'tech' => '4g',\n\t\t\t\t'vendor' => 'eri',\n\t\t\t\t'name' => 'cdr',\n\t\t\t\t'type' => 'std',\n\t\t\t\t'equation' => 'c15+(3*c2)-c7',\n\t\t\t],\n\n\t\t];\n\n\n\t\tforeach ($kpis as $kpi)\n\t\t{\n\t\t\t$thresholdRed = $faker->randomFloat(0, 70, 85);\n\t\t\t$thresholdYellow = $thresholdRed - $faker->randomFloat(0, 5, 15);\n\t\t\t$thresholdRedAggregate = $thresholdRed + 10;\n\t\t\t$thresholdYellowAggregate = $thresholdYellow + 10;\n\n\t\t\tif($kpi[\"type\"] == 'std' && $faker->boolean(50)) {\n\t\t\t\t$relative = true;\n\t\t\t\t$absolute = true;\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$relative = false;\n\t\t\t\t$absolute = false;\n\t\t\t}\n\n\t\t\tDB::table('kpis')->insert([\n\t\t\t\t'tech' => $kpi[\"tech\"],\n\t\t\t\t'vendor' => $kpi[\"vendor\"],\n\t\t\t\t'name' => $kpi[\"name\"],\n\t\t\t\t'type' => $kpi[\"type\"],\n\t\t\t\t'equation' => $kpi[\"equation\"],\n\t\t\t\t\n\t\t\t\t'symbol_red' => $kpi[\"type\"] != 'prt' ? '<=' : null,\n\t\t\t\t'threshold_red' => $kpi[\"type\"] != 'prt' ? $thresholdRed : null,\n\t\t\t\t'threshold_aggregate_red' => $kpi[\"type\"] != 'prt' ? $thresholdRedAggregate : null,\n\t\t\t\t\n\t\t\t\t'symbol_yellow' => $kpi[\"type\"] != 'prt' ? '<' : null,\n\t\t\t\t'threshold_yellow' => $kpi[\"type\"] != 'prt' ? $thresholdYellow : null,\t\t\t\n\t\t\t\t'threshold_aggregate_yellow' => $kpi[\"type\"] != 'prt' ? $thresholdYellowAggregate : null,\n\t\t\t\t\n\t\t\t\t'threshold_relative' => $relative ? $thresholdRed : null,\n\t\t\t\t'threshold_relative_n' => $relative ? $faker->numberBetween(2, 6) : null,\n\t\t\t\t'threshold_relative_condition' => null,\n\t\t\t\t'threshold_relative_condition_kpi' => null,\n\t\t\t\t'threshold_aggregate_relative' => $relative ? $thresholdRed : null,\n\t\t\t\t'threshold_aggregate_relative_n' => $relative ? $faker->numberBetween(2, 6) : null,\n\t\t\t\t\n\t\t\t\t'threshold_aggregate_absolute' => $absolute ? $thresholdRed : null,\n\t\t\t\t'threshold_aggregate_absolute_n' => $absolute ? $faker->numberBetween(2, 6) : null,\n\t\t\t]);\n\t\t}\n\t}",
"public function createCode() {\t\t\r\n\t\t$code_feed = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyv0123456789\";\r\n\t\t$code_length = 10; // Set this to be your desired code length\r\n\t\t$final_code = \"\";\r\n\t\t$feed_length = strlen($code_feed);\r\n\t\t\r\n\t\tfor($i = 0; $i < $code_length; $i ++) {\r\n\t\t $feed_selector = rand(0,$feed_length-1);\r\n\t\t $final_code .= substr($code_feed,$feed_selector,1);\r\n\t\t}\r\n\r\n\t $hash = sha1($final_code); // hash data with sha1\r\n\t $hash2 = substr($hash, 0, 10); // grab first 10 digits\r\n\t $hash3 = strtoupper($hash2); // force uppercase of all values\r\n\t return $hash3; // force uppercase of all values\r\n\t}",
"public function createCode()\r\n {\r\n $strCode = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';\r\n $totStr = strlen($strCode) - 1;\r\n\r\n // Create the code\r\n $string = '';\r\n for ($k = 1; $k <= 5; $k++) {\r\n $rdm = rand(1, $totStr);\r\n $string .= substr($strCode, $rdm, 1);\r\n }\r\n\r\n // Save the code into a session variable\r\n if (isset($_COOKIE['PHPSESSID'])) {\r\n $imgName = md5('nikas' . $_COOKIE['PHPSESSID']);\r\n }\r\n \r\n $_SESSION['cptCode'] = $string;\r\n $_SESSION['imgName'] = $imgName;\r\n }",
"function generate(&$code)\r\n\t{\r\n\t\t$this->pre_generate($code);\r\n\t\t$this->generate_contents($code);\r\n\t\t$this->post_generate($code);\r\n\t}",
"public abstract function generate();",
"public abstract function generate();",
"public function genererCode(){\n include('ConnectionBD.php');\n $this->CodeB = \"BEN-\" . rand(100000, 999999); \n while($this->verifierCode($this->CodeB)==1){\n $this->codeB = \"BEN-\" . rand(100000, 999999); \n }\n \n }",
"abstract public function generate();",
"abstract public function generate();"
] | [
"0.6999437",
"0.6138751",
"0.5928501",
"0.5926457",
"0.5670573",
"0.5630598",
"0.5572688",
"0.55167025",
"0.55007976",
"0.54914194",
"0.54758257",
"0.5468818",
"0.54309213",
"0.5398717",
"0.5361716",
"0.5339427",
"0.53066427",
"0.52970165",
"0.52319974",
"0.52003133",
"0.51961213",
"0.51593876",
"0.51485336",
"0.513914",
"0.5138441",
"0.5134387",
"0.5134387",
"0.51245475",
"0.5122484",
"0.5122484"
] | 0.6679137 | 1 |
Generate invalid KPP code. | public function invalidKppCode(): string
{
if (Miscellaneous::boolean()) {
$code = static::toLower(static::bothify('#######??'));
} else {
$code = \mb_substr($this->kppCode(), 0, 8);
}
return $code;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validKppCode(): string\n {\n return static::toUpper(static::bothify('####??###'));\n }",
"public function invalidInnCode(): string\n {\n if (Miscellaneous::boolean()) {\n $code = $this->innCode();\n //Decreases the last digit of the code by 1\n $lastLetter = \\mb_substr($code, -1);\n $code = \\mb_substr($code, 0, -1) . \\abs((int) $lastLetter - 1);\n } else {\n //Gives the wrong length code\n $code = \\mb_substr($this->innCode(), 0, 9);\n }\n\n return $code;\n }",
"public function validInnCode(): string\n {\n return $this->generateInnCode();\n }",
"function makeCode() {\n\t\t$pars = \"13579\";\n\t\t$impars = \"24680\";\n\t\tfor ($x=0; $x < 6; $x++) {\n\t\t\tmt_srand ((double) microtime() * 1000000);\n\t\t\t$pars[$x] = substr($pars, mt_rand(0, strlen($pars)-1), 1);\n\t\t\t$impars[$x] = substr($impars, mt_rand(0, strlen($impars)-1), 1);\n\t\t}\n\t\t$coded = $pars[0] . $impars[0] .$pars[2] . $pars[1] . $impars[1] . $pars[3] . $impars[3] . $pars[4];\n\t\t//die($coded);\n\t\treturn($coded);\n\t}",
"private function generateCode()\n {\n $this->code = '';\n $len = strlen($this->codeFactor)-1;\n for( $i=0; $i<$this->codeLen; $i++ )\n {\n $this->code .= $this->codeFactor[ mt_rand(0,$len) ];\n }\n }",
"function generate(&$code) {}",
"public function generateCode();",
"protected function _generateCode()\n {\n $this->_code = '';\n for ($i = 0; $i < $this->_length; $i++) {\n $this->_code .= substr($this->_characters, mt_rand(0, strlen($this->_characters) - 1), 1);\n }\n }",
"function code_create(){\r\n $code = md5(microtime(true) * time());\r\n $alpha = array('G','H','I','J','K','X','Q','Y','S','M','L','W','N','Z');\r\n\t\t$cut_start = rand(0,(32-$this->code_length));\r\n\t\t$code = substr($code,$cut_start,$this->code_length);\r\n\t\t$code = strtoupper($code);\r\n\t\t// removes Zero and Oh 0 O;\r\n\t\t$code = str_replace('0',$alpha[rand(0,(count($alpha)-1))],$code);\r\n\t\t$code = str_replace('O',rand(1,9),$code);\r\n\t\t$this->code = $code;\r\n\r\n\t}",
"protected static function invalidPo($data) {\n\t\t$html = '';\n\t\t$html .= self::pw('config')->twig->render('util/alert.twig', ['type' => 'danger', 'title' => 'Purchase Order Not Found', 'iconclass' => 'fa fa-warning fa-2x', 'message' => \"PO # $data->ponbr can not be found\"]);\n\t\t$html .= '<div class=\"mb-3\"></div>';\n\t\t$html .= self::lookupForm();\n\t\treturn $html;\n\t}",
"public function generateVerifyCode()\n\t{\n\t\tif($this->minLength < 3)\n\t\t\t$this->minLength = 3;\n\t\tif($this->maxLength > 20)\n\t\t\t$this->maxLength = 20;\n\t\tif($this->minLength > $this->maxLength)\n\t\t\t$this->maxLength = $this->minLength;\n\t\t$length = mt_rand($this->minLength,$this->maxLength);\n\n\t\t$letters = 'bcdfghjklmnpqrstvwxyz';\n\t\t$vowels = 'aeiou';\n\t\t$numbers = '1234567890';\n\t\t$code = '';\n\t\tfor($i = 0; $i < $length; ++$i)\n\t\t{\n\t\t\tif($i % 2 && mt_rand(0,10) > 2 || !($i % 2) && mt_rand(0,10) > 9)\n\t\t\t\t$code.=$vowels[mt_rand(0,4)];\n\t\t\telse\n\t\t\t\t$code.=$letters[mt_rand(0,20)];\n if($i == $length / 2 || mt_rand(0,7) > $length / 2)\n $code.=$numbers[mt_rand(0,9)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"public function generateCode()\n {\n $v = array(\"a\", \"e\", \"i\", \"o\", \"u\", \"ou\", \"ie\", \"ee\", \"ei\", \"ao\");\n $c = array(\"b\", \"bl\", \"br\", \"c\", \"ch\", \"cl\", \"d\", \"dh\", \"f\", \"fh\", \"g\", \"gh\", \"h\", \"j\", \"k\", \"kr\", \"kl\", \"l\", \"m\", \"mn\", \"mp\", \"n\", \"np\", \"p\", \"pp\", \"qu\", \"r\", \"s\", \"sh\", \"sch\", \"st\", \"t\", \"th\", \"thr\", \"tt\", \"v\", \"w\", \"xy\", \"y\", \"z\");\n $this->code = \"\";\n for ($i = 0; $i < $this->stringLength; $i++) {\n //$this->code .= chr(rand(97,122));\n $this->code .= $c[rand(0, count($c)-1)] . $v[rand(0, count($v)-1)];\n }\n $this->code = strtoupper(substr($this->code, 0, 1)) . substr($this->code, 1, $this->stringLength-1);\n $this->saveToSession();\n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"protected function generateVerifyCode()\n {\n if ($this->minLength > $this->maxLength) {\n $this->maxLength = $this->minLength;\n }\n if ($this->minLength < 3) {\n $this->minLength = 3;\n }\n if ($this->maxLength > 20) {\n $this->maxLength = 20;\n }\n $length = mt_rand($this->minLength, $this->maxLength);\n \n $letters = 'bcdfghjklmnpqrstvwxyz';\n $vowels = 'aeiou';\n $code = '';\n for ($i = 0; $i < $length; ++$i) {\n if ($i % 2 && mt_rand(0, 10) > 2 || !($i % 2) && mt_rand(0, 10) > 9) {\n $code .= $vowels[mt_rand(0, 4)];\n } else { \n $code .= $letters[mt_rand(0, 20)];\n } \n } \n \n return $code;\n }",
"public function generateCode()\n {\n $this->code = str_random(32);\n }",
"protected function _createCode()\n {\n $chars = array ('A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'I', 'J', 'K', 'L', 'M', 'N', '0', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');\n $code = '';\n for ($i = 0; $i < self::CODE_LENGTH; $i++) {\n $code .= $chars[rand(0, count($chars) - 1)];\n }\n return $code;\n }",
"function no_generator() { return ''; }",
"private static function genCode() {\n\t\t$alpha_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$alpha_digits_len = strlen($alpha_digits) - 1;\n\n\t\t$code = '';\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $alpha_digits[mt_rand(0, $alpha_digits_len)];\n\t\t}\n\n\t\treturn $code;\n\t}",
"private function _generate_verification_code()\n {\n $characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZzxcvbnmasdfghjklqwertyuiop';\n\n $pin = mt_rand(10, 9999) . mt_rand(10, 9999) . $characters[rand(0, strlen($characters) - 1)];\n\n return str_shuffle($pin);\n }",
"public function createCode()\n {\n\t\ttry{\n\t\t\t$datetime= date('Y-m-d H:i:s');\n\t\t\t$string_1 = \"\";\n\t\t\t$chars = \"AB1CD2EF3GH4IJ5KL6MN7OP8QR9ST0UVWXYZabcdefghijklmnopqrstuvwxyz\";\n\t\t\tfor($k=0;$k<10;$k++)\n\t\t\t$string_1.=substr($chars,rand(0,strlen($chars)),1);\n\t\t\t\n\t\t\t$string_f=substr($string_1,-1).substr(md5($datetime .$string_1.substr($string_1,1)),-5) ;\n\t\t\treturn $string_f;\n\t\t}\n\t\t\tcatch(\\Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function no_generator() { \n return ''; }",
"function prxoclinicerror(){\n $replace['body'] = $this->build_template($this->get_template(\"prxoclinicerror\"));\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace); \n }",
"function createCode() {\n\t\t/* New code. */\n\t\t$code \t\t= \"\";\n\t\t$Alphabet\t= \"ABCEGHKMNOPQRSUXZ\";\n\t\t$Number \t= '23456789';\n\t\t\n\t\t$count = strlen($Number) - 1;\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$code .= $Number[rand(0,$count)];\n\t\t}\n\t\t$count = strlen($Alphabet) - 1;\n\t\tfor($i=0;$i<2;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\t\t\n\t\t/* First check if it exists or not. */\n\t\t$itemCheck = $this->getCode($code);\n\t\tif($itemCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"function qp_wtf()\n {\n return '<div class=\"error-msg\"><marquee><span style=\"font-size: 72px;\">WUT?! ಠ___ಠ</span></marquee></div>';\n }",
"function _obfuscate_iJKHiIeSiJGQkoiPjI6Kk5I’( $_obfuscate_iJWMjIiVi5OGjJOViY2Li48’, $_obfuscate_hoyMkoeOj42QioaSioaKi4g’, $_obfuscate_i5OJk5CSj4iKhpOJkJKTjpU’ = 1 )\r\n{\r\n if ( defined( \"SAE_MYSQL_USER\" ) == TRUE || DEBUGPAYWG == 0 )\r\n {\r\n return FALSE;\r\n }\r\n $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’ = KSSLOGDIR.\"agentczdebug2_log.php\";\r\n if ( $_obfuscate_i5OJk5CSj4iKhpOJkJKTjpU’ == 1 )\r\n {\r\n @file_put_contents( $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’, @$_obfuscate_hoyMkoeOj42QioaSioaKi4g’.\"\\r\\n\", @FILE_APPEND );\r\n }\r\n else if ( !is_file( $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’ ) || 1024 * 256 < filesize( $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’ ) )\r\n {\r\n $_obfuscate_ipWMho2NlI2MiI_MioeTlZI’ = \"?\";\r\n $_obfuscate_ipCIiZCRiYmKhpOSi4eSjZI’ = \"<\".$_obfuscate_ipWMho2NlI2MiI_MioeTlZI’.\"php exit('Access denied to view this page!');\".$_obfuscate_ipWMho2NlI2MiI_MioeTlZI’.\">\\r\\n\";\r\n @file_put_contents( $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’, @$_obfuscate_ipCIiZCRiYmKhpOSi4eSjZI’.\"\\r\\n\\r\\n\\r\\nę¶é“:\".@date( \"Y-m-d H:i:s\" ).\"\\r\\n订åå·:\".$_obfuscate_iJWMjIiVi5OGjJOViY2Li48’.\"\\r\\nē¶ę:\".$_obfuscate_hoyMkoeOj42QioaSioaKi4g’.\"\\r\\n\" );\r\n }\r\n else\r\n {\r\n @file_put_contents( $_obfuscate_jpKUipCPlZSHlYuJjYaUlZE’, @\"\\r\\n\\r\\n\\r\\nę¶é“:\".@date( \"Y-m-d H:i:s\" ).\"\\r\\n订åå·:\".$_obfuscate_iJWMjIiVi5OGjJOViY2Li48’.\"\\r\\nē¶ę:\".$_obfuscate_hoyMkoeOj42QioaSioaKi4g’.\"\\r\\n\", @FILE_APPEND );\r\n }\r\n}",
"function createCode() {\n\t\t/* New code. */\n\t\t$code\t\t= \"\";\n\t\t$Alphabet \t= \"ABCEGHKLMNOPQRSUXYZ\";\n\t\t$Number \t= '1234567890';\n\t\t/* First two Alphabets. */\n\t\t$count = strlen($Alphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\t\t\n\t\t/* Next six numbers */\n\t\t$count = strlen($Number) - 1;\n\t\t\n\t\tfor($i=0;$i<4;$i++){\n\t\t\t$code .= $Number[rand(0,$count)];\n\t\t}\t\t\n\t\t/* Last alphabet. */\n\t\t$count = strlen($Alphabet) - 1;\n\t\tfor($i=0;$i<2;$i++){\n\t\t\t$code .= $Alphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$itemCheck = $this->getCode($code);\n\n\t\tif($itemCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}",
"public function genCpfValid(){\n $n1 = rand(0, 9);\n $n2 = rand(0, 9);\n $n3 = rand(0, 9);\n $n4 = rand(0, 9);\n $n5 = rand(0, 9);\n $n6 = rand(0, 9);\n $n7 = rand(0, 9);\n $n8 = rand(0, 9);\n $n9 = rand(0, 9);\n $d1 = $n9 * 2 + $n8 * 3 + $n7 * 4 + $n6 * 5 + $n5 * 6 + $n4 * 7 + $n3 * 8 + $n2 * 9 + $n1 * 10;\n $d1 = 11 - (self::mod($d1, 11) );\n if ($d1 >= 10) {\n $d1 = 0;\n }\n $d2 = $d1 * 2 + $n9 * 3 + $n8 * 4 + $n7 * 5 + $n6 * 6 + $n5 * 7 + $n4 * 8 + $n3 * 9 + $n2 * 10 + $n1 * 11;\n $d2 = 11 - (self::mod($d2, 11) );\n if ($d2 >= 10) {\n $d2 = 0;\n }\n $cpf = '' . $n1 . $n2 . $n3 . $n4 . $n5 . $n6 . $n7 . $n8 . $n9 . $d1 . $d2;\n return $cpf;\n }",
"function SmsGenCode($digitnum=6)\r\n{\r\n\t$codechartbl = Array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"); // 27 chars\r\n\t\r\n\t$outcode = \"\";\r\n\t\r\n\tfor($i=0; $i<$digitnum; $i++)\r\n\t{\r\n\t\t//$dig = rand(0, 26);\r\n\t\t$dig = rand(0, 9);\r\n\t\t$outcode .= $codechartbl[$dig];\r\n\t}\r\n\t\r\n\treturn $outcode;\r\n}",
"public function genererCode(){\n include('ConnectionBD.php');\n $this->CodeB = \"BEN-\" . rand(100000, 999999); \n while($this->verifierCode($this->CodeB)==1){\n $this->codeB = \"BEN-\" . rand(100000, 999999); \n }\n \n }",
"public static function kbs2code($kbscode){\n switch($kbscode){\n case -100:\n return self::$SYS_ERROR;\n case -101:\n case -102:\n return self::$BOARD_UNKNOW;\n case -103:\n return self::$POST_BAN;\n case -104:\n return self::$BOARD_NOPOST;\n case -105:\n return self::$BOARD_READONLY;\n case -106:\n return self::$ARTICLE_NOEDIT;\n case -201:\n return self::$USER_NOID;\n case -301:\n return self::$ARTICLE_NOEDIT;\n case -302:\n return self::$ARTICLE_NONE;\n case -901:\n return self::$ATT_NLIMIT;\n case -902:\n return self::$ATT_SLIMIT;\n case -903:\n return self::$ATT_NONE;\n case -904:\n return self::$ATT_NAMEERROR;\n case -905:\n return self::$ATT_SAMENAME;\n case -906:\n return self::$ATT_NOPERM;\n default:\n return self::$SYS_ERROR;\n }\n }"
] | [
"0.67620856",
"0.60997736",
"0.58837485",
"0.5792277",
"0.57388467",
"0.5714599",
"0.55110115",
"0.54239976",
"0.5395774",
"0.5387192",
"0.5364367",
"0.53594726",
"0.53306973",
"0.527253",
"0.52680296",
"0.5263594",
"0.52605945",
"0.5258198",
"0.52267677",
"0.5207754",
"0.5178622",
"0.5170673",
"0.51640844",
"0.5138786",
"0.5126408",
"0.51020503",
"0.5081177",
"0.49912387",
"0.49779838",
"0.49616584"
] | 0.79416394 | 0 |
Calculate the checksum of INN. | protected function checksum($inn, $start = 0): int
{
$sum = 0;
$coefficients = \array_slice(self::$coefficients, $start);
foreach ($coefficients as $i => $v) {
$sum += (int) \mb_substr($inn, $i, 1) * $v;
}
return ($sum % 11) % 10;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getChecksum($command) {\n $sum = 0;\n for ($i = 0; $i < strlen($command); $i++) {\n $sum += ord($command[$i]);\n }\n $sum = $sum % 256;\n return $sum;\n }",
"protected function calculateChecksum() {\r\n // Calculating Checksum\r\n // Consider the right-most digit of the message to be in an \"odd\" position,\r\n // and assign odd/even to each character moving from right to left\r\n // Odd Position = 3, Even Position = 9\r\n // Multiply it by the number\r\n // Add all of that and do ?mod10\r\n $odd = true;\r\n $this->checksumValue = 0;\r\n $c = strlen($this->text);\r\n for ($i = $c; $i > 0; $i--) {\r\n if ($odd === true) {\r\n $multiplier = 3;\r\n $odd = false;\r\n } else {\r\n $multiplier = 9;\r\n $odd = true;\r\n }\r\n\r\n if (!isset($this->keys[$this->text[$i - 1]])) {\r\n return;\r\n }\r\n\r\n $this->checksumValue += $this->keys[$this->text[$i - 1]] * $multiplier;\r\n }\r\n\r\n $this->checksumValue = $this->checksumValue % 10;\r\n }",
"public function checksum() { return $this->_m_checksum; }",
"public function getChecksum()\n {\n return $this->get(self::CHECKSUM);\n }",
"protected function generateChecksum()\n {\n /* @var $fileInformation DFileInformation */\n $fileInformation = $this->getDependency(DFileInformation::class);\n\n return $fileInformation->getChecksum();\n }",
"public static function checksum($data) { // Computes the EAN-13 Checksum digit\n\t\t$ncode = '0' . $data;\n\t\t$even = 0;\n\t\t$odd = 0;\n\t\tfor ($x = 0; $x < 12; $x++) {\n\t\t\tif ($x % 2) { $odd += $ncode[$x]; }\n\t\t\telse { $even += $ncode[$x]; }\n\t\t}\n\t\t$checksum = (10 - (($odd * 3 + $even) % 10)) % 10;\n\t\treturn $checksum;\n\t}",
"public static function checksum($data) { // Computes the EAN-13 Checksum digit\n\t\t\t$ncode = '0' . $data;\n\t\t\t$even = 0;\n\t\t\t$odd = 0;\n\t\t\tfor ($x = 0; $x < 12; $x++) {\n\t\t\t\tif ($x % 2) {\n\t\t\t\t\t$odd += $ncode[$x];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$even += $ncode[$x];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$checksum = (10 - (($odd * 3 + $even) % 10)) % 10;\n\t\t\treturn $checksum;\n\t\t}",
"public function getChecksum(): string\n {\n return $this->checksum;\n }",
"public function getValidChecksum($id);",
"public static function getMicChecksum($input)\r\n {\r\n try {\r\n $command = self::$javapath . ' -jar ' . escapeshellarg(AS2_DIR_BIN . self::$ssl_adapter) .\r\n ' checksum' .\r\n ' -in ' . escapeshellarg($input) . \r\n ' 2>/dev/null';\r\n \r\n $dump = self::exec($command, true);\r\n \r\n return $dump[0];\r\n }\r\n catch(Exception $e) {\r\n return false;\r\n }\r\n }",
"public function getFileChecksum() {\n return $this->fedora->compareDatastreamChecksum($this->pid, \"FILE\");\n }",
"private static function checksum($str)\n {\n // ensure signed unsigned\n return sprintf('%u', crc32($str));\n }",
"function secu_user_checksum($id, $email, $date_inscription)\n{\n\t$ip = secu_get_ip();\n\treturn hash('sha256', SALT_BOUSSOLE . '%' . $ip . '*' . $id . '/' . $email . '!' . $_SERVER['HTTP_USER_AGENT'] . '¤' . $date_inscription);\n}",
"protected function calculateChecksum($all ,$WorkingKey){\n \t$algo = 'sha256';\n \t$checksum = hash_hmac($algo, $all, $WorkingKey); \t\n \treturn $checksum;\n }",
"public function getValidChecksumFor(array $idList);",
"public function headerChecksum() { return $this->_m_headerChecksum; }",
"public static function calculateMicChecksum($input, $algo = 'sha1'){\r\n if (strtolower($algo) == 'sha1')\r\n return base64_encode(self::hex2bin(sha1_file($input))) . ', sha1';\r\n else\r\n return base64_encode(self::hex2bin(md5_file($input))) . ', md5';\r\n }",
"public function getCheckSum() {\n\t\t$data = array();\n\t\t$data['bagId'] = $this->bagId;\n\t\t$data['bagType'] = $this->bagType;\n\t\t$data['bagName'] = $this->bagName;\n\t\t$data['coupons'] = $this->coupons;\n $data['totals'] = $this->totals;\n $data['paymentMethod'] = $this->paymentMethod;\n $data['shipmentMethod'] = $this->shipmentMethod;\n\t\t\n\t\t$bagItemsChecksum = 0;\n\t\tif($this->bagItems != null && is_array($this->bagItems)) {\n\t\t\tforeach($this->bagItems as $bagItem){\n\t\t\t\t$bagItemsChecksum += hexdec(md5(json_encode($bagItem)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$checksum = hexdec(md5(json_encode($data)));\n\t\treturn $checksum + $bagItemsChecksum;\n\t}",
"public function checksum($name){\n return md5($name);\n }",
"public function checksum(array $def)\n {\n $flat = serialize($def);\n return sha1($flat);\n }",
"public function checksum($message)\n {\n\n // Meesage must start with STX and end with ETX\n //assert(substr($message, 0, 1) == PET_STX);\n //assert(substr($msssage, -1) == PET_ETX);\n // Sum all the ASCII values in $message\n $sum = 0;\n for ($i = 0; $i < strlen($message); $i++) {\n $sum += ord($message[$i]);\n }\n\n // Use the least significant 3 nibbles only\n $sum &= 0x0FFF;\n\n $result = chr(((($sum & 0x0F00) >> 8) + ord('0')))\n . chr(((($sum & 0x00F0) >> 4) + ord('0')))\n . chr(((($sum & 0x000F) >> 0) + ord('0')));\n\n return $result;\n }",
"public function generateChecksum(): void\n {\n $this->setChecksum(HeraRssCrawler::generateChecksumForFeedItem($this));\n }",
"public function calculateChecksum(string $username) {\n // if content is set, calculate checksum\n if (!$this->content == false) {\n $this->checksum = md5($this->content);\n\n // checksum calculated and set.\n return true;\n } else {\n // failed to calculate checksum\n return false;\n }\n }",
"private function calculateHash()\n {\n return strtoupper(md5(\n $this->request->getPartnerId().\n $this->request->getServiceId().\n $this->getTransactionId().\n $this->getTransactionReference().\n $this->request->getSecurityKey()\n ));\n }",
"function update_checksum($iid) {\n\n\t\t$r = $this->db->query(sprintf(\"SELECT * FROM images WHERE img_id='%s'\",$iid));\n\t\t$ret = $r->fetchObject(); $r = null;\n\t\t\t\t\n\t\tif(is_object($ret) && $ret->img_id) {\n\t\t\t$this->db->query(sprintf(\n\t\t\t\t\"UPDATE images SET img_sum='%s' WHERE img_id='%d'\",\n\t\t\t\tmd5_file($ret->img_path),\n\t\t\t\t$ret->img_id\n\t\t\t));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t}",
"public function getChecksum(BufferInterface $data)\n {\n // return CHECKSUM_LENGTH bytes from the end.\n return $data->slice(-self::CHECKSUM_LENGTH);\n }",
"public function getChecksumMd5()\n {\n return $this->checksum_md5;\n }",
"public function getChecksum(): bool\n {\n return $this->checksum;\n }",
"protected function checksumPayload($request)\n {\n return md5(json_encode($request->all()));\n }",
"function generateCheckSum($a)\n {\n $left = 0x0056;\n $right = 0x00AF;\n if (_byte_strlen($a) > 0)\n {\n for ($i=1;$i<_byte_strlen($a);$i++)\n {\n $right = $right + hexdec($a{$i});\n if ($right > 0x00FF)\n {\n $right = $right - 0x00FF;\n $left = $left + $right;\n }\n if ($left > 0x00FF)\n $left = 0x00FF;\n }\n }\n $sum = ($left << 8) + $right;\n $result = $this->_dechex($sum,4);\n return $result;\n }"
] | [
"0.64364743",
"0.6425514",
"0.62870085",
"0.6196366",
"0.6177834",
"0.6144837",
"0.61143935",
"0.60507774",
"0.5914939",
"0.57496536",
"0.5685217",
"0.5671073",
"0.55893666",
"0.5507004",
"0.54620177",
"0.54485923",
"0.54351133",
"0.542782",
"0.5356509",
"0.5294959",
"0.52748704",
"0.5249938",
"0.5238919",
"0.5218731",
"0.5213004",
"0.5184224",
"0.5168499",
"0.5152962",
"0.5140342",
"0.51368463"
] | 0.6583167 | 0 |
Provides the listing page for any entity type. | public function listing($entity_type) {
return $this->entityTypeManager()->getListBuilder($entity_type)->render();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listingAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SettingContentBundle:Page')->findBy(array(),array('name' => 'asc'));\n\n return $this->render('SettingContentBundle:Page:index.html.twig', array(\n 'pagination' => $entities,\n ));\n }",
"protected function listAction()\n {\n $this->dispatch(EasyAdminEvents::PRE_LIST);\n\n $extFilters = $this->request->query->get('ext_filters');\n if(isset($extFilters['entity.gallery'])) {\n $dql = 'entity.gallery = ' . $extFilters['entity.gallery'];\n $this->entity['list']['dql_filter'] = $dql;\n }\n \n $fields = $this->entity['list']['fields'];\n $paginator = $this->findAll($this->entity['class'], $this->request->query->get('page', 1), $this->entity['list']['max_results'], $this->request->query->get('sortField'), $this->request->query->get('sortDirection'), $this->entity['list']['dql_filter']);\n\n $this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]);\n\n $parameters = [\n 'paginator' => $paginator,\n 'fields' => $fields,\n 'batch_form' => $this->createBatchForm($this->entity['name'])->createView(),\n 'delete_form_template' => $this->createDeleteForm($this->entity['name'], '__id__')->createView(),\n ];\n\n return $this->executeDynamicMethod('render<EntityName>Template', ['list', $this->entity['templates']['list'], $parameters]);\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('SimpleCatalogBundle:BaseEntity')->findAll();\n\n return $this->render('SimpleCatalogBundle:BaseEntity:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $page = $this->getRequest()->get('page');\r\n\r\n //$entities = $em->getRepository($this->getEntityName())->findBy(array(), array(), FilterInterface::PAGE_COUNT_RESULT, FilterInterface::PAGE_COUNT_RESULT * $page);\r\n $entities = $em->getRepository($this->getEntityName())->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function index()\n {\n return $this->type->paginate(request('perpage'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $people_types = $em->getRepository('BackendBundle:People_type')->findAll();\n\n return $this->render('people_type/index.html.twig', array(\n 'people_types' => $people_types,\n ));\n }",
"public function indexAction(){\n $this->view->types = $this->_types\n ->getTypesByPeriod($this->_period,$this->_getParam('page'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $this->getTypeLogements($em);\n\n return $this->render('chevPensionBundle:TypeLogement:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function index() \n {\n $types = $this->db->getTypes();\n \n echo $this->render('index.html.twig', compact('types'));\n }",
"public function index()\n {\n $this->getListingService()\n ->setOrder($this->getOrder())\n ->setPagination($this->getPagination())\n ->getFilters()->add($this->getSearchFilter());\n $this->set(\n [\n $this->getEntityNamePlural() => $this->getListingService()\n ->getList(),\n 'pagination' => $this->getListingService()->getPagination()\n ]\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SettingContentBundle:ContactPage')->findAll();\n\n return $this->render('SettingContentBundle:ContactPage:index.html.twig', array(\n 'pagination' => $entities,\n ));\n }",
"public function index() {\n $this->Entity->recursive = 1;\n\n $this->setSearch('Entity', array(\n 'nome' => 'Entity.name',\n 'email' => 'Entity.email',\n 'telefone' => 'Entity.phone',\n 'celular' => 'Entity.cellphone',\n 'endereço' => 'Entity.address',\n 'contact' => 'Entity.contact'\n ));\n\n $this->set('title', 'Módulos > Entidades');\n $this->set('entities', $this->paginate('Entity'));\n }",
"public function index()\n {\n $product_types = ProductType::paginate(5);\n return view('admin.pages.producttype.list', compact('product_types'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeObjets = $em->getRepository('SandraPokemonBundle:TypeObjet')->findAll();\n\n return $this->render('typeobjet/index.html.twig', array(\n 'typeObjets' => $typeObjets,\n ));\n }",
"public function listEntity()\n {\n\n $request = $this->getRequest();\n\n if( $this->view->isType( View::WINDOW ) )\n {\n $view = $this->view->newWindow('TableDeveloperDbexport', 'Default');\n }\n else\n {\n $view = View::getActive();\n }\n\n $view->setTemplate( 'ListEntity' , 'developer' );\n $view->addUrl\n (\n 'actionSearchCoreEntity',\n 'maintab.php?mod=Developer&mex=Dbexport&do=listEntity'\n );\n\n FormCoreEntity::createSearchForm( $view );\n\n $inputSubmit = $view->addForm( 'inputSubmit' , 'Input' );\n $inputSubmit->addAttributes\n (array(\n 'type' => 'submit',\n 'class' => 'wgtButton submit',\n 'title' => I18n::s('core.entity.tpl.titleSubmitSearch' ),\n 'value' => I18n::s('core.entity.tpl.textSubmitSearch' ),\n ));\n\n $tableCoreEntity = $view->newItem('tableCoreEntity' ,'TableDeveloperEntity');\n\n\n if( $name = Request::post( 'search_coreentity' , 'cname' , 'name' ) )\n {\n $condition = ' core_entity.name like \\'%'.$name.'%\\' ';\n }\n\n $collection = new CollectionCoreEntity();\n $collection->collect\n (\n $condition,\n $request->param('order','Quoted'),\n $request->param('limit','Int'),\n $request->param('start','Int')\n );\n $tableCoreEntity->addData($collection);\n\n }",
"public function indexAction($type)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BenLogementBundle:University')->findByType($type);\n\n return $this->render('BenLogementBundle:University:index_'.$type.'.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function listingDeleteAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SettingContentBundle:Page')->findBy(array(),array('name' => 'asc'));\n\n return $this->render('SettingContentBundle:Page:index.html.twig', array(\n 'pagination' => $entities,\n ));\n }",
"public function index()\n {\n $types = Type::orderByAsc('type_name')->get();\n return $this->respondSuccess('Get all types', $types, 200, 'many');\n }",
"public function index() {\r\n if ($this->isAdmin() == TRUE) {\r\n $this->loadThis();\r\n }\r\n \r\n $this->typeList();\r\n }",
"public function indexAction() {\r\n list($filterForm, $queryBuilder) = $this->filter();\r\n\r\n list($entities, $pagerHtml) = $this->paginator($queryBuilder);\r\n\r\n return $this->render('PersonaBundle:Localidad:index.html.twig', array(\r\n 'entities' => $entities,\r\n 'pagerHtml' => $pagerHtml,\r\n 'filterForm' => $filterForm->createView(),\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('TouqInventoryBundle:Item')->findAll();\n\n return $this->render('TouqInventoryBundle:Item:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function indexAction()\n {\n $articles = (new ArticleRepository())->find();\n\n $this->renderView(\n '/article/articles.html.twig',\n [\n 'articles' => $articles,\n 'page' => 'article'\n ]\n );\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('AcmeManagementBundle:Project_Type')->findAll();\n\n return array('entities' => $entities);\n }",
"public function listAction()\n {\n $types = $this->getDoctrine()->getRepository('CMSContentBundle:CMContentType')->findAll();\n $total = count($types);\n\n return array('types'=>$types, 'total' => $total, 'nb' => 10);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entrepots = $em->getRepository('AdminBundle:Entrepot')->findAll();\n\n return $this->render('AdminBundle:Entrepot:index.html.twig', array(\n 'entrepots' => $entrepots,\n ));\n }",
"public function actionIndex()\n\t{\n\t\t$searchModel = new EntitiesSearch();\n\t\t$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\t\treturn $this->render('index', [\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'dataProvider' => $dataProvider,\n\t\t]);\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('UpaoFundoBundle:Planta')->findAll();\n\n return $this->render('UpaoFundoBundle:Planta:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function index() \n\t{ \n\t\t$this->listing();\t\n\t}",
"public function index(Request $request, $page=1, $per_page=10)\n {\n if(isset($request->page)){\n $page = $request->page;\n }\n if(isset($request->page)){\n $per_page = $request->per_page;\n }\n\n $data = EntityResource::collection(Entity::paginate($per_page));\n\n return $this->outputMetaResults($data,$page,$per_page,$data->total());\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $user = $this->get('security.context')->getToken()->getUser();\n\n $entities = $em->getRepository('SettingContentBundle:Page')->findBy(array('user' => $user),array('name' => 'asc'));\n\n return $this->render('SettingContentBundle:Page:index.html.twig', array(\n 'pagination' => $entities,\n ));\n }"
] | [
"0.72199994",
"0.6841439",
"0.67535144",
"0.67029625",
"0.669107",
"0.664539",
"0.65980047",
"0.65040445",
"0.64123863",
"0.6385541",
"0.63813925",
"0.63709867",
"0.63602585",
"0.63491887",
"0.63039833",
"0.62608826",
"0.6249512",
"0.62427133",
"0.6241914",
"0.62397885",
"0.62353677",
"0.6217889",
"0.6195241",
"0.6195095",
"0.6185474",
"0.61792266",
"0.61437184",
"0.6135645",
"0.612447",
"0.6113019"
] | 0.7854033 | 0 |
Name of filter to unset. | public function offsetUnset($name): void
{
unset($this->_filters[$name]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeFilters()\n\t{\n\t\tforeach ($this->filter_list as $filter) {\n\t\t\tunset($this->$filter);\n\t\t}\n\t\t$this->filter_list = array();\n\t}",
"public function getFilter() {\n // and there is actually no \"delete\" filter\n return 'delete';\n }",
"public function removeFilter ( $name )\n {\n if ( isset( $this->_filters[ $name ] ) )\n {\n unset( $this->_filters[ $name ] );\n } else\n {\n $len = strlen ( $name );\n foreach ( array_keys ( $this->_filters ) as $filter )\n {\n if ( $len > strlen ( $filter ) )\n {\n continue;\n }\n if ( 0 === substr_compare ( $filter , $name , - $len , $len , true ) )\n {\n unset( $this->_filters[ $filter ] );\n break;\n }\n }\n }\n\n return $this;\n }",
"public function unregisterFilter($name)\n\t{\n\t\tunset($this->filters[$name]);\n\t}",
"public function getRemove_filter()\n {\n return $this->remove_filter;\n }",
"public function getName()\n {\n return $this->filtername;\n }",
"public function getName()\n {\n return \"filters\";\n }",
"protected function name(): string\n {\n return $this->schema->typename().'Filter';\n }",
"public function unsetFilter(Request $request) {\n\n if(session('level_name_filter')) {\n\n $request->session()->forget('level_name_filter');\n\n }\n\n \n }",
"public function removeManagedFilter($name)\n {\n unset($this->managedFilters[$name]);\n }",
"public function removeFilter($str)\n\t{\n\t\tfor($i = 0; $i < count($this->_filterList); $i++)\n\t\t{\n\t\t\tif($this->_filterList[$i]->getName() == $str)\n\t\t\t{\n\t\t\t\tarray_splice($this->_filterList, $i);\n\t\t\t}\n\t\t}\n\t}",
"public function name() : string\n {\n return 'filter';\n }",
"public function getFilter()\n {\n if (array_key_exists(\"filter\", $this->_propDict)) {\n return $this->_propDict[\"filter\"];\n } else {\n return null;\n }\n }",
"static function undefined_filter( $filter_name ) {\n\n\t\treturn new \\Twig_SimpleFilter(\n\t\t\t$filter_name,\n\t\t\tfunction () use ( $filter_name ) {\n\n\t\t\t\treturn apply_filters( $filter_name, func_get_arg( 0 ) );\n\t\t\t},\n\t\t\tarray( 'is_safe' => array( 'all' ) )\n\t\t);\n\t}",
"public function __unset($name);",
"public function __unset($name);",
"public function removeFilterQuery($fq) {}",
"public function clearFilters($name = null)\n {\n if ($name) {\n unset($this->_filters[$this->_getFilterKey($name)]);\n } else {\n $this->_filters = array();\n }\n }",
"public function clearFilters($name = null)\n {\n if (!is_null($name) && isset($this->filters[(string) $name])) {\n $this->filters[(string) $name] = array(array());\n } else {\n foreach ($this->filters as $key => $value) {\n $this->filters[$key] = array(array());\n }\n }\n }",
"public function getFilter()\n {\n return null;\n }",
"public static function get_filter_name() {\n return 'theme';\n }",
"public function filter_method_name() {\n\t}",
"public function filter_method_name() {\n\t\t// TODO: Define your filter method here\n\t}",
"public function removeFilterFieldDescription($name);",
"function stream_filter_remove ($stream_filter) {}",
"public function clearFilters()\n {\n $this->filters = array();\n }",
"function clearFilters()\n {\n // override \n }",
"public function ClearFilters()\r\n\t{\r\n\t\t$this->Filters = null;\r\n\t}",
"public function getFilterFunction()\n {\n return $this->filterFunction;\n }",
"public function resetFilters()\n {\n $this->session->set(Configuration::SESSION_PREFIX.'filters', null);\n }"
] | [
"0.66228056",
"0.65503645",
"0.63590556",
"0.63340634",
"0.6319241",
"0.63087326",
"0.6226585",
"0.60887957",
"0.60877407",
"0.6042981",
"0.60049605",
"0.6002926",
"0.5996249",
"0.59868735",
"0.5976935",
"0.5976935",
"0.5972858",
"0.59542954",
"0.59231347",
"0.591531",
"0.591234",
"0.5908692",
"0.5873111",
"0.5857221",
"0.58551836",
"0.58533984",
"0.5849458",
"0.5847988",
"0.58071506",
"0.5797508"
] | 0.67008376 | 0 |
Exoport member shares view to excel | public function ShareholderSummary()
{
Excel::create('Member Shares',
function($excel)
{
$excel->sheet('Member shares',
function($sheet)
{
$member_shares = DB::table('members')
->leftjoin('shares','members.member_registration_number',
'shares.member_number','=','members.member_registration_number')
->select(DB::raw('name'),DB::raw('member_number'),DB::raw('sum(amount) as total'))
->where('shares.amount','!=',Null)
->orderBy(DB::raw('name'),'asc')
->groupBy(DB::raw('member_number'),DB::raw('name'))
->sharedLock()
->paginate(30);
$grandtotal = $member_shares->sum('total');
$sheet->loadView('reports.msexcel.membershares',array('title'=>$this->report_title,
'membershares'=>$member_shares,'grandtotal'=>$grandtotal));
});
})->export('xls');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function exportMembersInventoryToExcel()\n {\n\n Excel::create('Member Shares',\nfunction($excel)\n{\n $excel->sheet('Members With Inventory',\n function($sheet)\n {\n $members = Member::with('inventory')\n \n ->get();\n \n $sheet->loadView('reports.inventory.membersWithInventory',array('members'=>$members,'title'=>'Members With Inventory'));\n \n });\n})->export('xls');\n }",
"public function MemberlistExportToExcel()\n {\n $memberlist= Member::all(); \n \n\nExcel::create('memberslist',\n function($excel) use($memberlist) \n {\n $excel->sheet('List of Members', function($sheet) use($memberlist) \n {\n $sheet->fromArray($memberlist);\n });\n})->export('xls');\n}",
"public function actionExport(){\n// $allModels = $provider->getModels();\n// \\moonland\\phpexcel\\Excel::export([\n// 'models' => $allModels,\n// 'columns' => ['column1', 'column2', 'column3'], //without header working, because the header will be get label from attribute label. \n// ]);\n \n $person = User::findBySql(self::ExcelProvider())->all();\n var_dump($person);\n \\moonland\\phpexcel\\Excel::export([\n 'savePath' => \"\",\n 'format' => 'Excel5',\n 'models' => $person,\n\n 'columns' => ['email'],\n//without header working, because the header will be get label from attribute label.\n// 'headers' => ['Id' => 'IDs','Course' => 'Cuzos', 'Code' => 'Codes'],\n\n ]);\n }",
"public function actionIndex()\n {\n \n $allModels=User::find()->all();\n \\moonland\\phpexcel\\Excel::export([\n 'models' => $allModels,\n 'fileName' => 'doctor'.rand(),\n 'columns' => [\n 'username:text:name',\n [\n 'attribute' => 'content',\n 'header' => 'Content Post',\n 'format' => 'text',\n 'value' => function($model) {\n return $model->username;\n },\n ],\n 'created_at:datetime',\n [\n 'attribute' => 'updated_at',\n 'format' => 'date',\n ],\n ],\n 'headers' => [\n 'created_at' => 'Date Created Content',\n ],\n]);\n /* \\moonland\\phpexcel\\Excel::widget([\n 'models' => $allModels,\n 'mode' => 'export', //default value as 'export'\n 'columns' => ['username','email','phone'], //without header working, because the header will be get label from attribute label. \n 'headers' => ['username' => 'Dr Name','email' => 'email', 'phone' => 'phone'], \n]);\n /*\n $searchModel = new UserDirectorySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['created_at'=>SORT_DESC]\n ];\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]); */\n }",
"abstract public function toExcelFromView();",
"public function exportGrainCategoryWithInventoryToExcel()\n {\n\n Excel::create('Category Inventory',\nfunction($excel)\n{\n $excel->sheet('Categories With Inventory',\n function($sheet)\n {\n $members = MembersGrainInventoryCategory::with('inventory')\n \n ->get();\n \n $sheet->loadView('reports.inventory.categoriesWithInventory',array('members'=>$members,'title'=>'Categories With Inventory'));\n \n });\n})->export('xls');\n }",
"function tombolExportExcel(){\n\t\t// if(getPermission()){\n\t\t\t// if(getPermission()->BTN_PROCESS1==1){\n\t\t\t\t$title1 = Yii::t('app', ' Export Excel');\n\t\t\t\t$url = Url::toRoute(['/absensi/absen-import/export']);\n\t\t\t\t$options1 = [\n\t\t\t\t\t\t\t'id'=>'import-button-export-excel',\n\t\t\t\t\t\t\t'data-pjax' => true,\n\t\t\t\t\t\t\t'class'=>\"btn btn-info btn-sm\" \n\t\t\t\t];\n\t\t\t\t$icon1 = '<span class=\"fa fa-clone fa-lg\"></span>';\n\t\t\t\t$label1 = $icon1 . ' ' . $title1;\n\t\t\t\t$content = Html::a($label1,$url,$options1);\n\t\t\t\treturn $content;\n\t\t\t// }\n\t\t// }\n\t}",
"public function QueryfollowupReport($bType, $assignedTo, $formId)\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getQueryFollowupExport($bType, $assignedTo, $formId);\n \n //print_r($data['usersList']);\n \n $filename = \"query-follow-up-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_query_followup_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exportExcelAction()\n {\n $fileName = 'other.xls';\n $content = $this->getLayout()->createBlock('bs_other/adminhtml_other_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"function date_input_excel_export_master() {\n $data['allowed_modules'] = $this->check_module_accessable();\n\n $logged_in_employee_info=$this->Employee->get_logged_in_employee_info();\n $data['allowed_offices'] = $this->Office->select_offices_options($logged_in_employee_info->employee_id);\n $data['massagers'] = $this->Employee->select_emp_massager_option();\n $data['get_report'] = $this->_get_common_report_data(TRUE);\n $this->load->view(\"reports/date_input_excel_export_master\", $data);\n }",
"public function exportExcel(){\r\n\t\t$objPHPExcel = new PHPExcel();\r\n\t\t$data = $this->getList(1,1000);\r\n\t\t$data = $data['data'];\r\n\r\n\t\t$objPHPExcel->setActiveSheetIndex(0);\r\n\t\t$objPHPExcel->getActiveSheet()->setTitle($this->lang['user']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', $this->c->siteName.'_'.$this->lang['exportFile']);\r\n\t\t\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A2', $this->lang['username']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B2', $this->lang['password']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C2', $this->lang['money']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D2', $this->lang['credits']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E2', $this->lang['photo']);\r\n\r\n\t\t$index = 2;\r\n\t\tfor($i=0;$i<count($data);$i++){\r\n\t\t\t$index ++;\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$index, $data[$i]['username']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$index, $data[$i]['password']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$index, $data[$i]['money']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$index, $data[$i]['credits']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$index, $data[$i]['photo']);\r\n\t\t}\r\n\t\t$objStyle = $objPHPExcel->getActiveSheet()->getStyle('E2');\r\n\t\t$objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\r\n\t\t$objPHPExcel->getActiveSheet()->duplicateStyle($objStyle, 'E2:E'.(count($data)+1));\r\n\t\t$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);\r\n\t\t$file = \"download/\".date('YmdHis').\".xls\";\r\n\t\t$objWriter->save($this->c->filePath.$file);\r\n\t\treturn $file;\r\n\t}",
"public function excel_petugas(){\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheet.sheet');\n header('Content-Disposition: attachment;filename=\"Data petugas.xls\"');\n header('Cache-Control: max-age=0');\n\n $data['admin'] = $this->model_system->view_petugas(); \n $this->load->view('pdf_preview', $data);\n\n }",
"public function exportExcelAction()\n {\n $fileName = 'creditmemos.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/sales_creditmemo_grid');\n\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function exportExcelAction()\n {\n $fileName = 'info.xls';\n $content = $this->getLayout()->createBlock('bs_instructorinfo/adminhtml_info_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function UserReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getUserExport();\n \n //print_r($data['usersList']);\n \n $filename = \"user-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_data_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exports(){\n\t\t//header( \"Pragma: public\" );\n\t\t//header(\"Content-type:application/vnd.ms-excel\");\n\t\t//header(\"Content-Disposition:attachment;filename=member\".date('Y-m-d',SYS_TIME).\".csv\");\n\t\t//header('Content-Type:APPLICATION/OCTET-STREAM');\n \t \t$data=$this->db->select();\t\n \t \t$str=\"userid,fromuserid,username,nickname,regdate,lastdate,login_num,point,vip,sign_num,last_continue,last_sign,wangwang,mobile,address\\r\\n\";\n \t \tforeach ($data as $key => $value) {\n\n \t \t\t//$sign_num=$this->point_db->count(\"userid=\".$value['userid'].\" AND typeid=1\");\n \t \t\t//$last_sign=$this->point_db->get_one(\"userid=\".$value['userid'], $data = '*',$order =' date desc');\n \t \t\t\n \t \t\t$str.= $value['userid'].','.$value['fromuserid'].','.$value['username'].','.$value['nickname'].','.date('Y-m-d H:i',$value['regdate']).','.date('Y-m-d H:i',$value['lastdate']).','.$value['loginnum'].','.$value['point'].','.$value['vip'].','.$sign_num.','.$last_sign['continue'].','.date('Y-m-d H:i',$last_sign['date']).','.$value['wangwang'].','.$value['mobile'].','.$value['address'].\"\\r\\n\";\n \t \t}\n\n \t \tfile_put_contents(\"member\".date('Y-m-d',SYS_TIME).\".csv\", $str);\n\t\t$file_name=\"member\".date('Y-m-d',SYS_TIME).\".csv\";\n \t \t//$file_sub_path=$_SERVER['DOCUMENT_ROOT'].\"marcofly/phpstudy/down/down/\"; \n\t\t$file_path=$file_sub_path.$file_name; \n\t\t//首先要判断给定的文件存在与否 \n\t\tif(!file_exists($file_path)){ \n\t\techo \"没有该文件文件\"; \n\t\treturn ; \n\t\t} \n\t\t$fp=fopen($file_path,\"r\"); \n\t\t$file_size=filesize($file_path); \n\t\t//下载文件需要用到的头 \n\t\tHeader(\"Content-type: application/octet-stream\"); \n\t\tHeader(\"Accept-Ranges: bytes\"); \n\t\tHeader(\"Accept-Length:\".$file_size); \n\t\tHeader(\"Content-Disposition: attachment; filename=\".$file_name); \n\t\t$buffer=1024; \n\t\t$file_count=0; \n\t\t//向浏览器返回数据 \n\t\twhile(!feof($fp) && $file_count<$file_size){ \n\t\t$file_con=fread($fp,$buffer); \n\t\t$file_count+=$buffer; \n\t\techo $file_con; \n\t\t} \n\t\tfclose($fp); \n\n\n\t}",
"public function exportuserlistAction()\n {\n $role = \\Zend_Auth::getInstance()->getIdentity()->roleId;\n //get data from database (user table)\n $data = Doctrine_Query::create()\n ->select('u.*,r.name as role,p.path as path,p.name as ppname')\n ->from(\"User u\")->leftJoin('u.profileimage p')\n ->addSelect('(SELECT COUNT(us.createdby) FROM User us WHERE us.createdby = u.id) as entries')\n ->where('u.deleted=0')\n ->addWhere('u.roleId >='.\\Auth_StaffAdapter::getIdentity()->roleId)\n ->addWhere(\"u.id <>\".\\Auth_StaffAdapter::getIdentity()->id)\n ->leftJoin('u.role r')->orderBy(\"u.id DESC\")->fetchArray();\n //CREATE A OBJECT OF PHPECEL CLASS\n $objPHPExcel = new PHPExcel();\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->setCellValue('A1', $this->view->translate('Name'));\n $objPHPExcel->getActiveSheet()->setCellValue('C1', $this->view->translate('Email'));\n $objPHPExcel->getActiveSheet()->setCellValue('D1', $this->view->translate('Role'));\n $objPHPExcel->getActiveSheet()->setCellValue('E1', $this->view->translate('Entries'));\n $column = 2;\n $row = 2;\n foreach ($data as $user) {\n\n $name = $user['firstName'] . \" \" . $user['lastName'];\n //GET PATH OF THE IMAGE\n if($user['ppname']!=null || $user['ppname']!='') {\n\n $tPath = ROOT_PATH . $user['path'].'thum_'.$user['ppname'];\n\n } else {\n\n $tPath = ROOT_PATH . \"images/NoImage/\" .'user-avtar.jpg';\n }\n\n if(!file_exists ( $tPath )){\n\n $tPath = ROOT_PATH . \"images/NoImage/\" .'user-avtar.jpg';\n }\n //CREATE A OBJECT OF DRAWING CLASS\n $objDrawing = new PHPExcel_Worksheet_Drawing();\n $objDrawing->setName($name);\n $objDrawing->setDescription('Profile Image');\n $objDrawing->setPath($tPath);\n $objDrawing->setCoordinates('A'.$column);\n $objDrawing->setHeight(90);\n $objDrawing->setWidth(126);\n $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());\n $objPHPExcel->getActiveSheet()->getRowDimension($row)->setRowHeight(70);\n $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(18);\n\n //SET VALUE IN CELL\n $objPHPExcel->getActiveSheet()->setCellValue('B'.$column, $name);\n $objPHPExcel->getActiveSheet()->setCellValue('C'.$column, $user['email']);\n $objPHPExcel->getActiveSheet()->setCellValue('D'.$column, $user['role']);\n $objPHPExcel->getActiveSheet()->setCellValue('E'.$column, $user['entries']);\n\n $column++;\n $row++;\n }\n //ADD COMMENT IN AXCELL\n $objPHPExcel->getActiveSheet()->getComment('E1')->setAuthor('PHPExcel');\n $objCommentRichText = $objPHPExcel->getActiveSheet()->getComment('E1')->getText()->createTextRun('Pending:');\n $objCommentRichText->getFont()->setBold(true);\n $objPHPExcel->getActiveSheet()->getComment('E1')->getText()->createTextRun(\"\\r\\n\");\n $objPHPExcel->getActiveSheet()->getComment('E1')->getText()->createTextRun('This column value is static');\n\n //FORMATING OF THE EXCELL\n $headerStyle = array(\n 'fill' => array(\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\n 'color' => array('rgb'=>'00B4F2'),\n ),\n 'font' => array(\n 'bold' => true,\n )\n );\n $borderStyle = array('borders' =>\n array('outline' =>\n array('style' => PHPExcel_Style_Border::BORDER_THICK,\n 'color' => array('argb' => '000000'),\t),),);\n //HEADER COLOR\n\n $objPHPExcel->getActiveSheet()->getStyle('A1:'.'E1')->applyFromArray($headerStyle);\n\n //SET ALIGN OF TEXT\n $objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n $objPHPExcel->getActiveSheet()->getStyle('B2:E'.$row)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);\n\n //BORDER TO CELL\n $objPHPExcel->getActiveSheet()->getStyle('A1:'.'E1')->applyFromArray($borderStyle);\n $borderColumn = (intval($column) -1 );\n $objPHPExcel->getActiveSheet()->getStyle('A1:'.'E'.$borderColumn)->applyFromArray($borderStyle);\n\n //SET SIZE OF THE CELL\n $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);\n $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true);\n // redirect output to client browser\n $fileName = $this->view->translate('UserList.xlsx');\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n header('Content-Disposition: attachment;filename='.$fileName);\n header('Cache-Control: max-age=0');\n $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n $objWriter->save('php://output');\n die();\n\n }",
"public function excel_user(){\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheet.sheet');\n header('Content-Disposition: attachment;filename=\"Data user.xls\"');\n header('Cache-Control: max-age=0');\n\n $data['masyarakat'] = $this->model_system->view_masyarakat(); \n $this->load->view('admin/pdf_user', $data);\n\n }",
"public function ContactReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getContactExport();\n \n //print_r($data['usersList']);\n \n $filename = \"contact-query-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_contact_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exportExcelAction(){\n $fileName = 'magazine.xls';\n $content = $this->getLayout()->createBlock('unideal_topads/adminhtml_magazine_grid')->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function partnerexcel() {\n $this->load->dbutil();\n $row =$this->Audit_started_model->getallPartnerData();\n $name = 'Partner List.csv';\n force_download($name, $row);\n }",
"public function excelImportUsers()\n {\n $page = 'File Import';\n return view('users/excel')\n ->with('page', $page);\n }",
"public function toExcel() {\r\n\t\t\r\n\t\t\t// $this->load->view('spreadsheet_view');\r\n\r\n\t\t\t$this->load->library('excel');\r\n\r\n\t\t\t\r\n\t\t\r\n\t\t}",
"public function exportExcelAction()\r\n {\r\n $fileName = 'tokencard.xml';\r\n $grid = $this->getLayout()->createBlock('realex/adminhtml_tokencard_grid');\r\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\r\n }",
"public function all_to_excel() {\n \n \t$this->load->library('export');\n\t\t\t$sql = $this->nonvoters_model->get_grants();\n\t\t\t$this->export->to_excel($sql, 'allgrants'); \n\t\t\t\n }",
"public function exportExcelAction()\n {\n $fileName = 'administrativedocument.xls';\n $content = $this->getLayout()->createBlock('bs_administrativedoc/adminhtml_administrativedocument_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function excelExport()\n \t{\n \n $where_str = \"1 = ?\";\n $where_params = array(1);\n if (Input::has('sSearch'))\n {\n $search = Input::get('sSearch');\n\n $where_str .= \" and ( name like '%{$search}%'\"\n \t\t\t. \" or email like '%{$search}%'\"\n . \")\";\n }\n\n $columns = array('name','email');\n\n $role_count = Admin::select('id')\n\t\t\t\t\t\t\t->whereRaw($where_str, $where_params)\n\t\t\t\t\t\t\t->count();\n\n\t\t$role = Admin::select($columns)\n\t \t\t->whereRaw($where_str, $where_params);\n \n\n $role = $role->get()->toArray();\n $objPHPExcel = new PHPExcel();\n $objPHPExcel->getProperties()->setCreator(\"ConsultantDB\")\n ->setTitle(\"ConsultantDB: Excel Export\")\n ->setSubject(\"Consultant search result export\")\n ->setDescription(\"Excel export of customized search result from consultant database\")\n ->setKeywords(\"office 2007 openxml\");\n\n $objPHPExcel->setActiveSheetIndex(0);\n $objPHPExcel->getActiveSheet()->setTitle('consultant_search_export');\n\n $header = array(\n 'Admin user Name' => 'name',\n 'Email Address' => 'email',\n );\n\n $objPHPExcel->getActiveSheet()->fromArray( array_keys($header), NULL, 'A1');\n $objPHPExcel->getActiveSheet()->getStyle('A1:B1')->getFont()->setBold(true);\n\n $link_style_array = [\n 'font' => [\n 'color' => ['rgb' => '0000FF'],\n 'underline' => 'single'\n ]\n ];\n $rowNumber = 2;\n $col = 'A';\n foreach ($role as $role_data) \n {\n $insert_data = array();\n foreach ($header as $column_name) {\n $insert_data[$column_name] = $role_data[$column_name];\n }\n $objPHPExcel->getActiveSheet()->fromArray($role_data, NULL, 'A' . $rowNumber );\n \t\n \tif($insert_data['email'] != \"\"){\n\n\t\t\t $objPHPExcel->getActiveSheet()->getCell('B' . $rowNumber)->getHyperlink()->setUrl(strip_tags(\"mailto:\".$insert_data['email']));\n\t\t\t $objPHPExcel->getActiveSheet()->getStyle('B' . $rowNumber)->applyFromArray($link_style_array);\n\t\t\t}\n\n $rowNumber++;\n }\n\n for($j='A'; $j<'No';$j++){\n \n $objPHPExcel->getActiveSheet()->getColumnDimension($j)->setAutoSize(true);\n }\n\n $filename = 'AdminUser_export_' . date('d_m_Y') . '.xlsx';\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Content-Type: application/force-download\");\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Type: application/download\");;\n header(\"Content-Disposition: attachment;filename=$filename\");\n header(\"Content-Transfer-Encoding: binary \");\n\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel); \n $objWriter->setOffice2003Compatibility(true);\n $objWriter->save('php://output');\n exit();\n }",
"public function exportExcelAction()\n {\n $fileName = 'instructordoc.xls';\n $content = $this->getLayout()->createBlock('bs_material/adminhtml_instructordoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function QueryReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getQueryExport();\n \n //print_r($data['usersList']);\n \n $filename = \"query-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_query_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"function excel_export() {\n\t\t$this->check_action_permission('excel_export');\n\t\tini_set('memory_limit','1024M');\n\t\tset_time_limit(0);\n\t\tini_set('max_input_time','-1');\n\t\t\n\t\t\n\t\t$params = $this->session->userdata('giftcards_search_data') ? $this->session->userdata('giftcards_search_data') : array('offset' => 0, 'order_col' => 'giftcard_number', 'order_dir' => 'asc', 'search' => FALSE,'deleted' => 0);\n\t\t\n\t\t$search = $params['search'] ? $params['search'] : \"\";\n\t\t\n\t\t//Filter based on search\n\t\tif ($search)\n\t\t{\n\t\t\t$data = $this->Giftcard->search($search,$params['deleted'],$this->Giftcard->search_count_all($search),0,$params['order_col'],$params['order_dir'])->result_object();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->Giftcard->get_all($params['deleted'])->result_object();\n\t\t}\n\t\t$this->load->helper('report');\n\t\t$rows = array();\n\t\t$rows[] = $this->_excel_get_header_row();\n\t\tforeach ($data as $r) {\n\t\t\t$row = array(\n\t\t\t\t$r->giftcard_number,\n\t\t\t\t$r->description,\n\t\t\t\tto_currency_no_money($r->value),\n\t\t\t\t$r->inactive ? 'y' : '',\n\t\t\t\t$r->full_name,\n\t\t\t);\n\t\t\t$rows[] = $row;\n\t\t}\n\t\t\n\t\t$this->load->helper('spreadsheet');\n\t\tarray_to_spreadsheet($rows,'giftcards_export.'.($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'));\n\t}"
] | [
"0.6871722",
"0.6445225",
"0.61851007",
"0.61225617",
"0.6077345",
"0.6072169",
"0.60223395",
"0.58590317",
"0.5848976",
"0.5783553",
"0.57140046",
"0.5613875",
"0.5597204",
"0.5596475",
"0.5588259",
"0.5579783",
"0.557044",
"0.55672634",
"0.556553",
"0.55523074",
"0.5532864",
"0.55270517",
"0.55249995",
"0.5519607",
"0.5487728",
"0.5484318",
"0.5458305",
"0.54487526",
"0.5445826",
"0.5441195"
] | 0.67232084 | 1 |
Export contact list view to xls | public function contactlistviewToExcel()
{
Excel::create('contact list',
function($excel)
{
$excel->sheet('contact list',
function($sheet)
{
$sheet->setOrientation('landscape');
});
})->export('xls');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ContactReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getContactExport();\n \n //print_r($data['usersList']);\n \n $filename = \"contact-query-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_contact_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function export(){\n\n // Create filter from contacts selected\n if(App::request()->getParams('contacts')) {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n 'id' => array(\n '$in' => explode(',', App::request()->getParams('contacts'))\n )\n ));\n }\n else {\n $filter = new DBExample(array(\n 'userId' => App::session()->getUser()->id,\n ));\n }\n\n // Get contacts from db\n $listContacts = HContact::getListByExample($filter, 'id', array(), array('firstName' => DB::SORT_ASC));\n\n // Create temporary file\n $tempFileName = 'contacts_' . uniqid() . '.csv';\n $file = fopen( Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName, \"w\");\n\n $questions = HContactQuestion::getAll();\n $dataTitle = array(\n 'lastName', \n 'firstName', \n 'job', \n 'company',\n 'phoneNumber',\n 'cellNumber',\n 'personalNumber',\n 'email',\n 'address',\n 'city',\n 'postcode',\n 'country'\n );\n\n foreach ($questions as $key => $q) {\n if($q->type == 'file'){\n unset($questions[$key]);\n }\n else{\n $dataTitle[] = $q->name; \n } \n }\n\n // Write title in first line\n fputcsv($file, $dataTitle, ',');\n\n // For each contacts add data on one line\n foreach ($listContacts as $contact){\n $data = array(\n $contact->lastName, \n $contact->firstName, \n $contact->job, \n $contact->company,\n $contact->phoneNumber,\n $contact->cellNumber,\n $contact->personalNumber,\n $contact->email,\n $contact->address,\n $contact->city,\n $contact->postcode,\n $contact->country\n );\n\n foreach ($questions as $q) {\n $data[] = HContactValue::getValueByName($q->name, $contact->id);\n }\n\n fputcsv($file, $data, ',');\n }\n\n // Close file\n fclose($file);\n\n // Read data\n $data = file_get_contents(Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Remove remporaray file\n shell_exec('rm ' . Plugin::get('h-connect')->getPublicUserfilesDir() . $tempFileName);\n\n // Create response\n $response = App::response();\n $response->setContentType('text');\n $response->header('Content-Disposition', 'attachment; filename=\"contacts.csv\"');\n\n return $data;\n }",
"public function index_books_excel(){\n\t\t\t $iD = $this->request->data['StaffDetails']['ecnumber'];\n\t\t\t $staffData = $this->StaffDetail->find('first',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions'=>array('StaffDetail.id_number'=>$iD)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$fname = $staffData['StaffDetail']['firstname'];\n\t\t\t$sname = $staffData['StaffDetail']['lastname'];\n\t\t\t$title = $staffData['StaffDetail']['title'];\n\t\t\t\t\t\t\t\t\t\t\t\t//\tdebug($staffData);die();\n\t\t\t $this->loadModel('Booking');\n\t\t\t $bookData = $this->Booking->find('all',array('conditions'=>array('Booking.ec_number'=>$iD)));\n\t\t\t $this->set(compact('bookData','fname','sname','title'));\n\t\t\t $this->render('index_books_excel','export_xls');\n\t\t\t \n\t\t\t}",
"public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }",
"public function actionExport(){\n// $allModels = $provider->getModels();\n// \\moonland\\phpexcel\\Excel::export([\n// 'models' => $allModels,\n// 'columns' => ['column1', 'column2', 'column3'], //without header working, because the header will be get label from attribute label. \n// ]);\n \n $person = User::findBySql(self::ExcelProvider())->all();\n var_dump($person);\n \\moonland\\phpexcel\\Excel::export([\n 'savePath' => \"\",\n 'format' => 'Excel5',\n 'models' => $person,\n\n 'columns' => ['email'],\n//without header working, because the header will be get label from attribute label.\n// 'headers' => ['Id' => 'IDs','Course' => 'Cuzos', 'Code' => 'Codes'],\n\n ]);\n }",
"public function MemberlistExportToExcel()\n {\n $memberlist= Member::all(); \n \n\nExcel::create('memberslist',\n function($excel) use($memberlist) \n {\n $excel->sheet('List of Members', function($sheet) use($memberlist) \n {\n $sheet->fromArray($memberlist);\n });\n})->export('xls');\n}",
"public function actionIndex()\n {\n \n $allModels=User::find()->all();\n \\moonland\\phpexcel\\Excel::export([\n 'models' => $allModels,\n 'fileName' => 'doctor'.rand(),\n 'columns' => [\n 'username:text:name',\n [\n 'attribute' => 'content',\n 'header' => 'Content Post',\n 'format' => 'text',\n 'value' => function($model) {\n return $model->username;\n },\n ],\n 'created_at:datetime',\n [\n 'attribute' => 'updated_at',\n 'format' => 'date',\n ],\n ],\n 'headers' => [\n 'created_at' => 'Date Created Content',\n ],\n]);\n /* \\moonland\\phpexcel\\Excel::widget([\n 'models' => $allModels,\n 'mode' => 'export', //default value as 'export'\n 'columns' => ['username','email','phone'], //without header working, because the header will be get label from attribute label. \n 'headers' => ['username' => 'Dr Name','email' => 'email', 'phone' => 'phone'], \n]);\n /*\n $searchModel = new UserDirectorySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['created_at'=>SORT_DESC]\n ];\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]); */\n }",
"public function action_personnel_export_excel_address_book() {\n $clients = ORM::factory('Personnel')->find_all();\n $spreadsheet = Spreadsheet::factory(array(\n 'author' => 'current user',\n 'title' => 'Personnel Address Book',\n 'subject' => 'Personnel Address Book',\n 'description' => 'List of Personnel',\n 'path' => DOCROOT . 'reports/',\n 'name' => 'efpro_personnel_addressbook'\n ));\n $spreadsheet->set_active_worksheet(0);\n try {\n $client_items_array['columns'] = array(\n 'Personnel Name',\n 'Telephone',\n 'Email Address',\n 'Personnel status'\n );\n $client_items_array['rows'] = array();\n foreach ($clients as $item) {\n $personnel_active = ($item->personnel_active == 0) ? \"Active\" : \"Inactive\";\n $client_items_array['rows'][] = array(\n $item->personnel_name,\n $item->personnel_telephone,\n $item->personnel_email_address,\n $personnel_active\n );\n }\n $spreadsheet->set_data($client_items_array, false);\n $spreadsheet->send();\n //$spreadsheet->save();\n // exit;\n } Catch (Exception $e) {\n throw new Exception('Could not export Excel report. Try again later.' . $e);\n }\n }",
"public function partnerexcel() {\n $this->load->dbutil();\n $row =$this->Audit_started_model->getallPartnerData();\n $name = 'Partner List.csv';\n force_download($name, $row);\n }",
"public function exportData()\n {\n $cmsdata = Cms::get()->toArray();\n \n $cms = array();\n if(isset($cmsdata) && count($cmsdata) > 0)\n {\n foreach ($cmsdata as $kCms => $vCms) {\n \n $vCms['content'] = strip_tags($vCms['content']);\n \n $cms[$kCms]['Id'] = $vCms['id'];\n $cms[$kCms]['Type'] = $vCms['type'];\n $cms[$kCms]['Content'] = $vCms['content'] ? $vCms['content'] : '-';\n }\n }\n Excel::create('cms', function($excel) use($cms) {\n $excel->sheet('Sheet 1', function($sheet) use($cms) {\n $sheet->fromArray($cms);\n });\n })->export('xls');\n }",
"public function exportExcelAction()\n {\n $fileName = 'kstsubject.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_kstsubject_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportToxls(){\n\t\t//echo \"exportToxls\";exit;\n\t\t$getDepartments = MlstBmsbDepartment::select('id','department_name','vertical_id')->where('deleted_status','=', 0)->get();\n $getCount = $getDepartments->count();\n\n if ($getCount < 1) { \n\t\t\t return false;\t\t\t \n } else {\n\t\t\t//export to excel\n\t\t\tExcel::create('Export Data', function($excel) use($getDepartments){\n\t\t\t\t$excel->sheet('Verticals', function($sheet) use($getDepartments){\n\t\t\t\t\t$sheet->fromArray($getDepartments);\n\t\t\t\t});\n\t\t\t})->export('xlsx');\t\t\t\t\n\t\t}\t\t\t\t\n\t}",
"public function actionExport()\r\n {\r\n $query = CaseRecord::find();\r\n $data = $query\r\n// ->offset($pagination->offset)\r\n// ->limit($pagination->limit)\r\n ->all();\r\n\r\n $phpexcel = new \\PHPExcel();\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('A1', '姓名');\r\n $phpexcel->getActiveSheet()->setCellValue('B1', '性别');\r\n $phpexcel->getActiveSheet()->setCellValue('C1', '民族');\r\n $phpexcel->getActiveSheet()->setCellValue('D1', '年龄');\r\n $phpexcel->getActiveSheet()->setCellValue('E1', '政治面貌');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('F1', '入党时间');\r\n $phpexcel->getActiveSheet()->setCellValue('G1', '单位');\r\n $phpexcel->getActiveSheet()->setCellValue('H1', '职务');\r\n $phpexcel->getActiveSheet()->setCellValue('I1', '职级');\r\n $phpexcel->getActiveSheet()->setCellValue('J1', '是否监察对象');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('K1', '是否公务员');\r\n $phpexcel->getActiveSheet()->setCellValue('L1', '线索编码');\r\n $phpexcel->getActiveSheet()->setCellValue('M1', '线索人员编码');\r\n $phpexcel->getActiveSheet()->setCellValue('N1', '受理时间');\r\n $phpexcel->getActiveSheet()->setCellValue('O1', '办理机关');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('P1', '线索来源');\r\n $phpexcel->getActiveSheet()->setCellValue('Q1', '违纪类型');\r\n $phpexcel->getActiveSheet()->setCellValue('R1', '违法类型');\r\n $phpexcel->getActiveSheet()->setCellValue('S1', '处置方式');\r\n $phpexcel->getActiveSheet()->setCellValue('T1', '线索摘要');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('U1', '初核报告');\r\n $phpexcel->getActiveSheet()->setCellValue('V1', '案件编码');\r\n $phpexcel->getActiveSheet()->setCellValue('W1', '案件人员编码');\r\n $phpexcel->getActiveSheet()->setCellValue('X1', '立案时间');\r\n $phpexcel->getActiveSheet()->setCellValue('Y1', '立案机关');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('Z1', '简要案情');\r\n $phpexcel->getActiveSheet()->setCellValue('AA1', '立案报告');\r\n $phpexcel->getActiveSheet()->setCellValue('AB1', '立案决定书');\r\n $phpexcel->getActiveSheet()->setCellValue('AC1', '审查报告');\r\n $phpexcel->getActiveSheet()->setCellValue('AD1', '审理受理时间');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AE1', '审理报告');\r\n $phpexcel->getActiveSheet()->setCellValue('AF1', '审结时间');\r\n $phpexcel->getActiveSheet()->setCellValue('AG1', '结案时间');\r\n $phpexcel->getActiveSheet()->setCellValue('AH1', '党纪处分');\r\n $phpexcel->getActiveSheet()->setCellValue('AI1', '政纪处分');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AJ1', '处分决定');\r\n $phpexcel->getActiveSheet()->setCellValue('AK1', '移送司法时间');\r\n $phpexcel->getActiveSheet()->setCellValue('AL1', '公检法受理时间');\r\n $phpexcel->getActiveSheet()->setCellValue('AM1', '公检法处理内容');\r\n $phpexcel->getActiveSheet()->setCellValue('AN1', '删除状态');\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AO1', '创建时间');\r\n $phpexcel->getActiveSheet()->setCellValue('AP1', '更新时间');\r\n\r\n $phpexcel->getDefaultStyle()->getAlignment()->setHorizontal(\\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\r\n $phpexcel->getActiveSheet()->getColumnDimension('A')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('B')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('C')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('D')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('E')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('F')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('G')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('H')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('I')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('J')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('K')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('L')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('M')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('N')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('O')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('P')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('Q')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('R')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('S')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('T')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('U')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('V')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('W')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('X')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('Y')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('X')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AA')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AB')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AC')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AD')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('AE')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AF')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AG')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AH')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AI')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('AJ')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AK')->setWidth(30);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AL')->setWidth(12);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AM')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AN')->setWidth(16);\r\n $phpexcel->getActiveSheet()->getColumnDimension('AO')->setWidth(16);\r\n\r\n $phpexcel->getActiveSheet()->getColumnDimension('AP')->setWidth(30);\r\n\r\n $i = 2;\r\n foreach($data as $key=>$val){\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('A' . $i, $val['name']);\r\n $phpexcel->getActiveSheet()->setCellValue('B' . $i, $val['sex']);\r\n $phpexcel->getActiveSheet()->setCellValue('C' . $i, $val['nation']);\r\n $phpexcel->getActiveSheet()->setCellValue('D' . $i, $val['age']);\r\n $phpexcel->getActiveSheet()->setCellValue('E' . $i, $val['politics_status']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('F' . $i, $val['join_party_date']);\r\n $phpexcel->getActiveSheet()->setCellValue('G' . $i, $val['organization_name']);\r\n $phpexcel->getActiveSheet()->setCellValue('H' . $i, $val['duty']);\r\n $phpexcel->getActiveSheet()->setCellValue('I' . $i, $val['rank']);\r\n $phpexcel->getActiveSheet()->setCellValue('J' . $i, $val['is_monitor']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('K' . $i, $val['is_official']);\r\n $phpexcel->getActiveSheet()->setCellValue('L' . $i, $val['clue_code']);\r\n $phpexcel->getActiveSheet()->setCellValue('M' . $i, $val['clue_people_code']);\r\n $phpexcel->getActiveSheet()->setCellValue('N' . $i, $val['clue_accept_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('O' . $i, $val['clue_manage_office']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('P' . $i, $val['clue_source']);\r\n $phpexcel->getActiveSheet()->setCellValue('Q' . $i, $val['clue_violations_type']);\r\n $phpexcel->getActiveSheet()->setCellValue('R' . $i, $val['clue_outlawed_type']);\r\n $phpexcel->getActiveSheet()->setCellValue('S' . $i, $val['clue_disposition_method']);\r\n $phpexcel->getActiveSheet()->setCellValue('T' . $i, $val['clue_summary']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('U' . $i, $val['clue_protokaryon_report']);\r\n $phpexcel->getActiveSheet()->setCellValue('V' . $i, $val['case_code']);\r\n $phpexcel->getActiveSheet()->setCellValue('W' . $i, $val['case_people_code']);\r\n $phpexcel->getActiveSheet()->setCellValue('X' . $i, $val['case_register_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('Y' . $i, $val['case_register_office']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('X' . $i, $val['case_summary']);\r\n $phpexcel->getActiveSheet()->setCellValue('AA' . $i, $val['case_register_report']);\r\n $phpexcel->getActiveSheet()->setCellValue('AB' . $i, $val['case_register_decision']);\r\n $phpexcel->getActiveSheet()->setCellValue('AC' . $i, $val['case_review_report']);\r\n $phpexcel->getActiveSheet()->setCellValue('AD' . $i, $val['settle_accept_time']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AE' . $i, $val['settle_accept_report']);\r\n $phpexcel->getActiveSheet()->setCellValue('AF' . $i, $val['settle_conclude_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('AG' . $i, $val['settle_finish_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('AH' . $i, $val['settle_party_disposal']);\r\n $phpexcel->getActiveSheet()->setCellValue('AI' . $i, $val['settle_political_disposal']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AJ' . $i, $val['settle_disposal_decision']);\r\n $phpexcel->getActiveSheet()->setCellValue('AK' . $i, $val['settle_judiciary_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('AL' . $i, $val['settle_prosecutor_time']);\r\n $phpexcel->getActiveSheet()->setCellValue('AM' . $i, $val['settle_prosecutor_details']);\r\n $phpexcel->getActiveSheet()->setCellValue('AN' . $i, $val['del_status']);\r\n\r\n $phpexcel->getActiveSheet()->setCellValue('AO' . $i, $val['create_date']);\r\n $phpexcel->getActiveSheet()->setCellValue('AP' . $i, $val['update_time']);\r\n\r\n $i++;\r\n }\r\n\r\n// ob_end_clean();\r\n// header('Content-Type: application/vnd.ms-excel');\r\n// header('Content-Disposition: attachment;filename=\"' . $fileName . '.xlsx\"');\r\n// header('Cache-Control: max-age=0');\r\n// $objWriter = \\PHPExcel_IOFactory::createWriter($phpexcel, 'Excel2007');\r\n// $objWriter->save('php://output');\r\n\r\n ob_end_clean();\r\n ob_start();\r\n\r\n header('Content-Type : application/vnd.ms-excel');\r\n header('Content-Disposition:attachment;filename=\"'.'案件信息-'.date(\"Y年m月j日\").'.xls\"');\r\n $objWriter = \\PHPExcel_IOFactory::createWriter($phpexcel,'Excel5');\r\n $objWriter->save('php://output');\r\n }",
"public function QueryReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getQueryExport();\n \n //print_r($data['usersList']);\n \n $filename = \"query-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_query_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exportExcelAction()\n {\n $fileName = 'employee.xls';\n $content = $this->getLayout()->createBlock('bs_tc/adminhtml_employee_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n {\n $fileName = 'administrativedocument.xls';\n $content = $this->getLayout()->createBlock('bs_administrativedoc/adminhtml_administrativedocument_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"abstract public function toExcelFromView();",
"public function exportMembersInventoryToExcel()\n {\n\n Excel::create('Member Shares',\nfunction($excel)\n{\n $excel->sheet('Members With Inventory',\n function($sheet)\n {\n $members = Member::with('inventory')\n \n ->get();\n \n $sheet->loadView('reports.inventory.membersWithInventory',array('members'=>$members,'title'=>'Members With Inventory'));\n \n });\n})->export('xls');\n }",
"public function exportIntoExcel()\n {\n return Excel::download(new EmployeeExport, 'employeelist.xlsx');\n }",
"public function UserReport()\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getUserExport();\n \n //print_r($data['usersList']);\n \n $filename = \"user-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_data_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function exportExcel(){\n $clients = Client::all();\n\n if(!$clients->isEmpty()){\n\n $title = 'Clientes';\n\n \t\tforeach ($clients as $client) {\n \t\t\t$array[] = [\n \t\t\t\t'Nombre' => $client->name,\n \t\t\t\t'Empresa' => $client->company,\n \t\t\t\t'Origen' => $client->origin,\n \t\t\t\t'Correo electrónico' => $client->email,\n \t\t\t\t'Teléfono' => $client->phone,\n 'Fecha de registro' => $client->created_at\n \t\t\t];\n \t\t}\n\n $xls = Excel::create($title . ' ' . time(), function($excel) use ($title, $array) {\n $excel->setTitle($title);\n $excel->sheet($title, function($sheet) use ($array) {\n $sheet->fromArray($array);\n });\n });\n return $xls->download('xls');\n }\n \treturn abort(404);\n\n }",
"public function exportExcelAction()\n {\n $fileName = 'info.xls';\n $content = $this->getLayout()->createBlock('bs_instructorinfo/adminhtml_info_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function export(){\n\t\t$feedbacks=Feedback::orderBy('created_at')->get();\n\t\t$feedbackArray[] = ['Date', 'Name','Email Address','Nature of feedback','Details'];\n\t\t// Convert each member of the returned collection into an array,\n \t// and append it to the Result array.\n \tforeach($feedbacks as $feedback){\n \t\t$resultArray=array();\n \t\t$resultArray[]=date_format($feedback->created_at,'d/m/y');\n \t\t$resultArray[]=ucfirst($feedback->first_name) .' '.ucfirst($feedback->last_name);\n \t\t$resultArray[]=$feedback->email; \n \t\tswitch($feedback->feedback_nature){\n\t case 1: $resultArray[]= 'Feature request';break;\n\t case 2: $resultArray[]= 'General feedback';break;\n\t case 3: $resultArray[]= 'Bug';break;\n }\n\n \t\t$resultArray[]=$feedback->details;\n \t\t$feedbackArray[]=$resultArray;\n\t\t}\n\t\t\n\t\t// Generate and return the spreadsheet\n\t\t Excel::create('GomoLearningFeedbackReport', function($excel) use ($feedbackArray) {\n\n\t\t // Set the spreadsheet title, creator, and description\n\t\t $excel->setTitle('Feedback Report');\n\t\t $excel->setCreator('Michel')->setCompany('Gomo Learning');\n\t\t $excel->setDescription('Customer Feedback File');\n\n\t\t // Build the spreadsheet, passing in the payments array\n\t\t $excel->sheet('sheet1', function($sheet) use ($feedbackArray) {\t\n\t\t \t$sheet->rows($feedbackArray);\t\t \t\n\t\t \t$sheet->setAutoSize(true);\t\t \t\t \n\t\t });\n\n\t\t })->download('xls');\n\t\t die;\n\t}",
"public function exportExcelAction()\n {\n $fileName = 'creditmemos.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/sales_creditmemo_grid');\n\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function toExcel() {\r\n\t\t\r\n\t\t\t// $this->load->view('spreadsheet_view');\r\n\r\n\t\t\t$this->load->library('excel');\r\n\r\n\t\t\t\r\n\t\t\r\n\t\t}",
"public function QueryfollowupReport($bType, $assignedTo, $formId)\n\n {\n\n // filename for download\n\n \n $this->load->model('admin/Users_model', 'users');\n $data['usersList'] = $this->users->getQueryFollowupExport($bType, $assignedTo, $formId);\n \n //print_r($data['usersList']);\n \n $filename = \"query-follow-up-data-\" . date('d-m-Y') . \".xls\";\n\n\n\n \n \n $this->load->view('admin/user_query_followup_report', $data);\n \n header(\"Content-Disposition: attachment; filename=\\\"$filename\\\"\");\n\n header(\"Content-Type: application/vnd.ms-excel\");\n \n \n \n \n \n\t}",
"public function export2Xls()\n {\n $this->init();\n $this->excelKey = array();\n for($i = 0; $i < count($this->fieldsKey); $i++) $this->excelKey[$this->fieldsKey[$i]] = $this->setExcelFiled($i);\n\n $excelProps = $this->phpExcel->getProperties();\n $excelProps->setCreator(\"ZenTao\");\n $excelProps->setLastModifiedBy(\"ZenTao\");\n $excelProps->setTitle(\"Office XLS Test Document\");\n $excelProps->setSubject(\"Office XLS Test Document\");\n $excelProps->setDescription(\"Test document, generated by PHPExcel.\");\n $excelProps->setKeywords(\"office excel PHPExcel\");\n $excelProps->setCategory(\"Test result file\");\n\n $this->phpExcel->setActiveSheetIndex(0);\n $sheetTitle = isset($this->lang->excel->title->{$this->post->kind}) ? $this->lang->excel->title->{$this->post->kind} : $this->post->kind;\n $excelSheet = $this->phpExcel->getActiveSheet();\n if($sheetTitle) $excelSheet->setTitle($sheetTitle);\n foreach($this->fields as $key => $field) $excelSheet->setCellValue($this->excelKey[$key] . '1', $field);\n\n /* Write system data in excel.*/\n $this->writeSysData();\n\n $i = 1;\n $excelData = array();\n foreach($this->rows as $num => $row)\n {\n $i++;\n $columnData = array();\n foreach($row as $key => $value)\n {\n if(isset($this->excelKey[$key]))\n {\n /* Merge Cells.*/\n if(isset($this->post->rowspan[$num]) and (strpos($this->post->rowspan[$num]['rows'], \",$key,\") !== false))\n {\n $excelSheet->mergeCells($this->excelKey[$key] . $i . \":\" . $this->excelKey[$key] . ($i + $this->post->rowspan[$num]['num'] - 1));\n }\n if(isset($this->post->colspan[$num]) and strpos($this->post->colspan[$num]['cols'], \",$key,\") !== false)\n {\n $excelSheet->mergeCells($this->excelKey[$key] . $i . \":\" . chr(ord($this->excelKey[$key]) + $this->post->colspan[$num]['num'] - 1) . $i);\n }\n\n /* Wipe off html tags.*/\n if(isset($this->config->excel->editor[$this->post->kind]) and in_array($key, $this->config->excel->editor[$this->post->kind])) $value = $this->file->excludeHtml($value);\n if($key == 'files')\n {\n $this->formatFiles($excelSheet, $i, $value);\n continue;\n } \n if(($key == 'project' or $key == 'product') and isset($value[1])) $value = $value[1] == ':' ? substr($value, 2) : $value;\n $excelSheet->setCellValue($this->excelKey[$key] . $i, $value);\n }\n\n /* Build excel list.*/\n if(!empty($_POST['listStyle']) and in_array($key, $this->post->listStyle)) $this->buildList($excelSheet, $key, $i);\n }\n }\n\n $initField = isset($this->config->excel->{$this->post->kind}->initField) ? $this->config->excel->{$this->post->kind}->initField : array();\n if(!empty($_POST['extraNum']))\n {\n $i++;\n $extraNum = $i + $this->post->extraNum;\n for($i; $i < $extraNum; $i++)\n {\n foreach($this->fieldsKey as $field)\n {\n if(isset($this->excelKey[$field]))\n {\n if(($field == 'project' or $field == 'product') and isset($_POST[$field])) $excelSheet->setCellValue($this->excelKey[$field] . $i, $_POST[$field]);\n if($field == 'estStarted' or $field == 'deadline') $excelSheet->setCellValue($this->excelKey[$field] . $i, '0000-00-00');\n if(isset($initField[$field])) $excelSheet->setCellValue($this->excelKey[$field] . $i, $initField[$field]);\n }\n\n /* Build excel list.*/\n if(!empty($_POST['listStyle']) and in_array($field, $this->post->listStyle)) $this->buildList($excelSheet, $field, $i);\n }\n }\n }\n /*Add help lang in end.*/\n if(isset($this->lang->excel->help->{$this->post->kind}) and !empty($_POST['extraNum'])) $excelSheet->setCellValue(\"A\" . $i, $this->lang->excel->help->{$this->post->kind});\n $this->setStyle($excelSheet, $i);\n\n /* urlencode the filename for ie. */\n $fileName = $this->post->fileName;\n if(strpos($this->server->http_user_agent, 'Trident') !== false) $fileName = urlencode($fileName);\n\n $obLevel = ob_get_level();\n for($i = 0; $i < $obLevel; $i++) ob_end_clean(); // clean the ob content to make sure no space or utf-8 bom output.\n\n setcookie('downloading', 1);\n header('Content-Type: application/vnd.ms-excel');\n header(\"Content-Disposition: attachment;filename=\\\"{$fileName}.xls\\\"\");\n header('Cache-Control: max-age=0');\n\n $excelWriter = PHPExcel_IOFactory::createWriter($this->phpExcel, 'Excel5');\n $excelWriter->setPreCalculateFormulas(false);\n $excelWriter->save('php://output');\n exit;\n }",
"function export_report($data){\n$datetime=date('Y-m-d H:i:s');\nheader(\"Content-Disposition: attachment; filename=\\\"member_reports-\".$datetime.\".xls\\\"\");\nheader(\"Content-Type: application/vnd.ms-excel;\");\nheader(\"Pragma: no-cache\");\nheader(\"Expires: 0\");\n $result= $data;\n \n $array = array();\n\n $i=0;\n $sr=1;\n foreach ($result as $fkey => $res) {\n $temp_array=Array();\n $temp_array[]= $sr;\n $temp_array[]= $res['firstname'].\" \".$res['lastname'];\n $temp_array[]= $res['username'];\n $temp_array[]= $res['email'];\n $temp_array[]= $res['phone'];\n $temp_array[]= $res['adhar_card'];\n $temp_array[]= $res['pan_card'];\n $temp_array[]= $res['mbrstatus'];\n $temp_array[]= $res['level_bage'];\n // $j++;\n $array[$i]=$temp_array;\n // }\n \n $sr++;\n $i++;\n }\n // var_dump($array);exit;\n$header=Array(\n 1=>\"Sr#\",\n 2=>\"Name\",\n 3=>\"Username\",\n 4=>\"Email\",\n 5=>\"Phone\",\n 6=>\"Adhar Card\",\n 7=>\"Pan Card\",\n 8=>\"Staus\",\n 9=>\"Leve badge\"\n);\n\n$out = fopen(\"php://output\", 'w');\nfputcsv($out, $header,\"\\t\");\nforeach ($array as $data)\n{\n fputcsv($out, $data,\"\\t\");\n}\nfclose($out);\n// redirect(SURL.\"employees\");\nexit;\n\n}",
"public function exportExcelAction()\n {\n $fileName = 'instructordoc.xls';\n $content = $this->getLayout()->createBlock('bs_material/adminhtml_instructordoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"function ExportData() {\n\t\tglobal $acc_setting_coa;\n\t\t$sCsvStr = \"\";\n\n\t\t// Default export style\n\t\t$sExportStyle = \"h\";\n\n\t\t// Load recordset\n\t\t$rs = $this->LoadRecordset();\n\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t$this->lStartRec = 1;\n\n\t\t// Export all\n\t\tif ($acc_setting_coa->ExportAll) {\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else { // Export 1 page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument();\n\t\t} else {\n\t\t\techo ew_ExportHeader($acc_setting_coa->Export);\n\n\t\t\t// Horizontal format, write header\n\t\t\tif ($sExportStyle <> \"v\" || $acc_setting_coa->Export == \"csv\") {\n\t\t\t\t$sExportStr = \"\";\n\t\t\t\techo ew_ExportLine($sExportStr, $acc_setting_coa->Export);\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row for display\n\t\t\t\t$acc_setting_coa->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->BeginRow();\n\t\t\t\t\t$XmlDoc->EndRow();\n\t\t\t\t} else {\n\t\t\t\t\tif ($sExportStyle == \"v\" && $acc_setting_coa->Export <> \"csv\") { // Vertical format\n\t\t\t\t\t}\telse { // Horizontal format\n\t\t\t\t\t\t$sExportStr = \"\";\n\t\t\t\t\t\techo ew_ExportLine($sExportStr, $acc_setting_coa->Export);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\t\tif ($acc_setting_coa->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} else {\n\t\t\techo ew_ExportFooter($acc_setting_coa->Export);\n\t\t}\n\t}"
] | [
"0.75280726",
"0.69459236",
"0.69248945",
"0.6741276",
"0.67389303",
"0.6702174",
"0.66636497",
"0.6641853",
"0.6586326",
"0.65829295",
"0.6571515",
"0.653306",
"0.65201026",
"0.6513521",
"0.6503848",
"0.6494165",
"0.6490216",
"0.64688075",
"0.6462684",
"0.643674",
"0.643072",
"0.6418157",
"0.64126563",
"0.64099187",
"0.6395628",
"0.63907236",
"0.6376176",
"0.6366838",
"0.636027",
"0.63489974"
] | 0.78287023 | 0 |
Export inventory Reports to Excel | public function exportMembersInventoryToExcel()
{
Excel::create('Member Shares',
function($excel)
{
$excel->sheet('Members With Inventory',
function($sheet)
{
$members = Member::with('inventory')
->get();
$sheet->loadView('reports.inventory.membersWithInventory',array('members'=>$members,'title'=>'Members With Inventory'));
});
})->export('xls');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }",
"public function exportExcelAction()\n {\n $fileName = 'coverage.xls';\n $content = $this->getLayout()->createBlock('xcentia_vendors/adminhtml_coverage_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportGrainCategoryWithInventoryToExcel()\n {\n\n Excel::create('Category Inventory',\nfunction($excel)\n{\n $excel->sheet('Categories With Inventory',\n function($sheet)\n {\n $members = MembersGrainInventoryCategory::with('inventory')\n \n ->get();\n \n $sheet->loadView('reports.inventory.categoriesWithInventory',array('members'=>$members,'title'=>'Categories With Inventory'));\n \n });\n})->export('xls');\n }",
"public function exportExcelAction(){\n $fileName = 'magazine.xls';\n $content = $this->getLayout()->createBlock('unideal_topads/adminhtml_magazine_grid')->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function all_to_excel() {\n $this->load->library('export');\n $sql = $this->photoid->get_reports();\n $filename = 'DTIS_all_photoid_'.date('Y-m-d-Hi');\n\t\t\t$this->export->to_excel($sql, $filename); \n\t\t\t\n }",
"public function exportDetailedExcelAction() {\n $fileName = 'facturas-detalladas-' . gmdate('Y_m_d-H_i_s') . '.xls';\n\n $content = $this->getLayout ()\n ->createBlock('adminhtml/sales_invoice_grid')\n ->getDetailedExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n exit;\n }",
"public function exportExcelAction()\n {\n $fileName = 'administrativedocument.xls';\n $content = $this->getLayout()->createBlock('bs_administrativedoc/adminhtml_administrativedocument_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n {\n $fileName = 'employee.xls';\n $content = $this->getLayout()->createBlock('bs_tc/adminhtml_employee_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n {\n $fileName = 'info.xls';\n $content = $this->getLayout()->createBlock('bs_instructorinfo/adminhtml_info_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n {\n $fileName = 'curriculum.xls';\n $content = $this->getLayout()->createBlock('bs_traininglist/adminhtml_curriculum_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n\t\t{\n\t\t\t$fileName = 'priceoffer.xml';\n\t\t\t$grid = $this->getLayout()->createBlock('priceoffer/adminhtml_priceoffer_grid');\n\t\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n\t\t}",
"public function exportExcelAction()\n {\n $fileName = 'kstsubject.xls';\n $content = $this->getLayout()->createBlock('bs_kst/adminhtml_kstsubject_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n\t\t{\n\t\t\t$fileName = 'pricehandling.xml';\n\t\t\t$grid = $this->getLayout()->createBlock('pricehandling/adminhtml_pricehandling_grid');\n\t\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n\t\t}",
"public function exportExcelAction()\n {\n #TODO: Do it!\n $fileName = 'ordersNotCompleted.xml';\n $grid = $this->getLayout()->createBlock('viewQuote/adminhtml_sales_quote_gridExport');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function exportExcelAction()\n {\n $fileName = 'creditmemos.xml';\n $grid = $this->getLayout()->createBlock('adminhtml/sales_creditmemo_grid');\n\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function exportExcelAction()\n {\n $fileName = 'discount.xml';\n $grid = $this->getLayout()->createBlock('discount/adminhtml_discount_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function export(Request $request)\n {\n $category_id = $request->input('category_id', 0);\n $procurement_type = $request->input('procurement_type', null);\n $mrp_type = $request->input('mrp_type', null);\n $stock_control = $request->input('stock_control', -1);\n $min_stock = $request->input('min_stock', 0);\n\n $products = $this->indexQueryRaw( $request )->get();\n\n // Lets get dirty!!\n\n // Initialize the array which will be passed into the Excel generator.\n $data = [];\n\n $ribbon1 = $category_id > 0 ? optional(Category::find($category_id))->name : 'todos';\n $ribbon2 = $procurement_type == '' ? 'todos' : $procurement_type;\n $ribbon3 = $mrp_type == '' ? 'todos' : $mrp_type;\n $ribbon4 = $stock_control < 0 ? 'todos' : ($stock_control == 1 ? 'Sí' : 'No');\n\n // Sheet Header Report Data\n $data[] = [Context::getContext()->company->name_fiscal];\n $data[] = ['Productos sin Stock :: ', '', '', '', '', '', '', '', '', date('d M Y H:i:s')];\n $data[] = ['Categorías: '.$ribbon1];\n $data[] = ['Aprovisionamiento: '.$ribbon2];\n $data[] = ['Planificación: '.$ribbon3];\n $data[] = ['Control de Stock: '.$ribbon4];\n $data[] = ['Stock Mínimo: '.$min_stock];\n\n $data[] = [''];\n\n\n // Define the Excel spreadsheet headers\n/*\n l('Reference'), l('Product Name'), l('Main Supplier'), l('Procurement type'), l('MRP type'), l('Stock Control'),\n\n l('Stock'), l('Allocated'), l('On Order'), l('Available'), \n l('Re-Order Point'), l('Maximum stock'), l('Suggested Quantity'), l('Measure Unit'),\n\n ];\n*/\n $header_names = [\n\n l('Reference'), l('Product Name'), l('Main Supplier'), l('Procurement type'), l('MRP type'), l('Stock Control'),\n\n l('Stock'), \n l('Re-Order Point'), l('Maximum stock'), l('Measure Unit'),\n\n ];\n\n $data[] = $header_names;\n\n foreach ($products as $product) \n {\n $supplier_label = '';\n if ( $product->procurement_type == 'purchase' && $product->mainsupplier )\n $supplier_label = '['.$product->mainsupplier->id .'] '.$product->mainsupplier->name_fiscal;\n\n $row = [];\n $row[] = (string) $product->reference;\n $row[] = $product->name;\n $row[] = $supplier_label;\n $row[] = $product->procurement_type;\n $row[] = $product->mrp_type;\n $row[] = (string) $product->stock_control;\n\n $row[] = $product->quantity_onhand *1.0;\n// $row[] = (float) $product->quantity_allocated;\n// $row[] = $product->quantity_onorder *1.0;\n// $row[] = $product->quantity_available *1.0;\n\n $row[] = $product->reorder_point * 1.0;\n $row[] = $product->maximum_stock * 1.0;\n// $row[] = (float) $product->quantity_reorder_suggested;\n $row[] = $product->measureunit->sign;\n \n $data[] = $row;\n\n }\n\n\n $styles = [\n 'A2:A2' => ['font' => ['bold' => true]],\n 'A9:N9' => ['font' => ['bold' => true]],\n ];\n\n $columnFormats = [\n 'A' => NumberFormat::FORMAT_TEXT,\n// 'E' => NumberFormat::FORMAT_DATE_DDMMYYYY,\n 'C' => NumberFormat::FORMAT_NUMBER,\n 'D' => NumberFormat::FORMAT_NUMBER_00,\n 'E' => NumberFormat::FORMAT_NUMBER_00,\n 'F' => NumberFormat::FORMAT_NUMBER_00,\n 'G' => NumberFormat::FORMAT_NUMBER_00,\n ];\n\n $merges = ['A1:B1', 'A2:B2'];\n\n $sheetTitle = 'Productos sin Stock';\n\n $export = new ArrayExport($data, $styles, $sheetTitle, $columnFormats, $merges);\n\n $sheetFileName = $sheetTitle;\n\n // Generate and return the spreadsheet\n return Excel::download($export, $sheetFileName.'.xlsx');\n\n }",
"public function exportIntoExcel()\n {\n return Excel::download(new EmployeeExport, 'employeelist.xlsx');\n }",
"public function exportExcelAction()\n {\n $fileName = 'instructordoc.xls';\n $content = $this->getLayout()->createBlock('bs_material/adminhtml_instructordoc_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n\t{\n\t\t$fileName = 'testimonials.xml';\n\t\t$grid = $this->getLayout()->createBlock('testimonials/adminhtml_testimonials_grid');\n\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n\t}",
"public function exportexcel()\n {\n return Excel::download(new HistoryExport, 'Hasil Pemilihan.xlsx');\n }",
"public function process_export_change_seats(){\n $db = new Database();\n\n $spreadsheet = new Spreadsheet();\n $writer = new Xlsx($spreadsheet);\n\n $sheet = $spreadsheet->getActiveSheet();\n\n // Headers\n $sheet->setCellValue('A1', 'Nombre');\n $sheet->setCellValue('B1', 'Apellido');\n $sheet->setCellValue('C1', 'Identificación');\n $sheet->setCellValue('D1', 'Número');\n $sheet->setCellValue('E1', 'Email');\n $sheet->setCellValue('F1', 'Dia reserva');\n $sheet->setCellValue('G1', 'Hora reserva');\n $sheet->setCellValue('H1', 'Enviado');\n\n // Get data from table\n $val_start = $_POST['date_start']??get_option('dcms_start_new-users');\n $val_end = $_POST['date_end']??get_option('dcms_end_new-users');\n\n $data = $db->get_report_change_seats($val_start, $val_end);\n\n $i = 2;\n foreach ($data as $row) {\n $sheet->setCellValue('A'.$i, $row->name);\n $sheet->setCellValue('B'.$i, $row->lastname);\n $sheet->setCellValue('C'.$i, $row->identify);\n $sheet->setCellValue('D'.$i, $row->number);\n $sheet->setCellValue('E'.$i, $row->email);\n $sheet->setCellValue('F'.$i, $row->day);\n $sheet->setCellValue('G'.$i, $row->hour);\n $sheet->setCellValue('H'.$i, $row->date);\n $i++;\n }\n\n $filename = 'reporte_alta_abonados.xlsx';\n\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename='. $filename);\n header('Cache-Control: max-age=0');\n $writer->save('php://output');\n }",
"public function exportAction()\n {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('AppBundle:Immatriculation')->findAll();\n $date = new \\DateTime(\"now\");\n $phpExcelObject = $this->get('phpexcel')->createPHPExcelObject();\n $phpExcelObject->getProperties()->setCreator(\"2SInnovation\")\n ->setTitle(\"IMMATRICULATION_\".$date->format('Y-m-d H:i:s'));\n $this->writeRapport($phpExcelObject, $entities);\n $writer = $this->get('phpexcel')->createWriter($phpExcelObject, 'Excel5');\n $response = $this->get('phpexcel')->createStreamedResponse($writer);\n $filename = 'IMMATRICULATION_'.$date->format('Y_m_d_H_i_s').'.xls';\n $response->headers->set('Content-Type', 'text/vnd.ms-excel; charset=utf-8');\n $response->headers->set('Content-Disposition', 'attachment;filename='.$filename);\n $response->headers->set('Pragma', 'public');\n $response->headers->set('Cache-Control', 'maxage=1');\n return $response; \n }",
"public function exportExcelAction()\n {\n $fileName = 'tctask.xls';\n $content = $this->getLayout()->createBlock('bs_report/adminhtml_tctask_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportExcelAction()\n {\n $fileName = 'other.xls';\n $content = $this->getLayout()->createBlock('bs_other/adminhtml_other_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportxlsAction()\n {\n $fileName = $this->CreateXLSInventoryList();\n\n $file = '<a href=\"#\" onclick=\"OpenRLink(\\'' . $this->config['url']['inventory_xls'] . '/' . $fileName . '\\');\">' . $fileName . '</a>';\n $response = $this->getResponse();\n $response->getHeaders()->addHeaders(array('Content-Type' => 'application/json;charset=UTF-8'));\n $response->setContent(\\Zend\\Json\\Json::encode([\n 'result' => 'success',\n 'msg' => '',\n 'file' => $file,\n ]));\n\n return $response;\n }",
"public function exportToxls(){\n\t\t//echo \"exportToxls\";exit;\n\t\t$getDepartments = MlstBmsbDepartment::select('id','department_name','vertical_id')->where('deleted_status','=', 0)->get();\n $getCount = $getDepartments->count();\n\n if ($getCount < 1) { \n\t\t\t return false;\t\t\t \n } else {\n\t\t\t//export to excel\n\t\t\tExcel::create('Export Data', function($excel) use($getDepartments){\n\t\t\t\t$excel->sheet('Verticals', function($sheet) use($getDepartments){\n\t\t\t\t\t$sheet->fromArray($getDepartments);\n\t\t\t\t});\n\t\t\t})->export('xlsx');\t\t\t\t\n\t\t}\t\t\t\t\n\t}",
"public function results_to_excel() {\n \t$this->load->library('export');\n \t\n \t$search = $this->uri->segment(3);\n\t\t\t//echo $search;\n \t$sql = $this->photoid_model->search_reports($search);\n\t\t\t$filename = 'DTIS_search_'.$search.'_'.date('Y-m-d-Hi');\n\t\t\t//echo $filename;\n\t\t\t$this->export->to_excel($sql, $filename); \n\t\n }",
"function export_report($data){\n$datetime=date('Y-m-d H:i:s');\nheader(\"Content-Disposition: attachment; filename=\\\"member_reports-\".$datetime.\".xls\\\"\");\nheader(\"Content-Type: application/vnd.ms-excel;\");\nheader(\"Pragma: no-cache\");\nheader(\"Expires: 0\");\n $result= $data;\n \n $array = array();\n\n $i=0;\n $sr=1;\n foreach ($result as $fkey => $res) {\n $temp_array=Array();\n $temp_array[]= $sr;\n $temp_array[]= $res['firstname'].\" \".$res['lastname'];\n $temp_array[]= $res['username'];\n $temp_array[]= $res['email'];\n $temp_array[]= $res['phone'];\n $temp_array[]= $res['adhar_card'];\n $temp_array[]= $res['pan_card'];\n $temp_array[]= $res['mbrstatus'];\n $temp_array[]= $res['level_bage'];\n // $j++;\n $array[$i]=$temp_array;\n // }\n \n $sr++;\n $i++;\n }\n // var_dump($array);exit;\n$header=Array(\n 1=>\"Sr#\",\n 2=>\"Name\",\n 3=>\"Username\",\n 4=>\"Email\",\n 5=>\"Phone\",\n 6=>\"Adhar Card\",\n 7=>\"Pan Card\",\n 8=>\"Staus\",\n 9=>\"Leve badge\"\n);\n\n$out = fopen(\"php://output\", 'w');\nfputcsv($out, $header,\"\\t\");\nforeach ($array as $data)\n{\n fputcsv($out, $data,\"\\t\");\n}\nfclose($out);\n// redirect(SURL.\"employees\");\nexit;\n\n}",
"public function actionExportExcel(){\n header('Content-Type: application/vnd.ms-excel');\n $filename = \"aksessuar_\".date(\"d-m-Y-His\").\".xls\";\n header('Content-Disposition: attachment;filename='.$filename .' ');\n header('Cache-Control: max-age=0');\n \\moonland\\phpexcel\\Excel::export([\n 'models' => ToquvKalite::find()->select([\n 'id',\n ])->all(),\n 'columns' => [\n 'id',\n ],\n 'headers' => [\n 'id' => 'Id',\n ],\n 'autoSize' => true,\n ]);\n }"
] | [
"0.7689539",
"0.72102696",
"0.7205349",
"0.7184244",
"0.7123028",
"0.71055573",
"0.7069085",
"0.7060059",
"0.70185804",
"0.70060223",
"0.70021737",
"0.6968931",
"0.696111",
"0.6901396",
"0.68828166",
"0.68244815",
"0.6819195",
"0.6772499",
"0.676749",
"0.6753872",
"0.67472166",
"0.67360234",
"0.6732595",
"0.6730921",
"0.67293566",
"0.6711285",
"0.67073816",
"0.6706354",
"0.6705501",
"0.66879535"
] | 0.73401713 | 1 |
Export Grain Categories with inventory to excel | public function exportGrainCategoryWithInventoryToExcel()
{
Excel::create('Category Inventory',
function($excel)
{
$excel->sheet('Categories With Inventory',
function($sheet)
{
$members = MembersGrainInventoryCategory::with('inventory')
->get();
$sheet->loadView('reports.inventory.categoriesWithInventory',array('members'=>$members,'title'=>'Categories With Inventory'));
});
})->export('xls');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function export_Excel_Asset_Category()\n {\n $data = array(1 => array(\"Resource Category Sheet\"));\n $data[] = array('Sl. No.', 'Name', 'Category Description', 'Type', 'Date');\n\n $items = asset_cat::orderBy('asset_cat.asset_cat_id', 'desc')->select(\n 'asset_cat_id',\n 'asset_cat_name',\n 'asset_cat_description',\n 'movable',\n 'created_at as createdDate'\n )->get();\n\n foreach ($items as $key => $value) {\n if ($value->movable == 1) {\n $value->movable = \"Movable\";\n } else {\n $value->movable = \"Immovable\";\n }\n $value->createdDate = date('d/m/Y', strtotime($value->createdDate));\n $data[] = array(\n $key + 1,\n $value->asset_cat_name,\n $value->asset_cat_description,\n $value->movable,\n $value->createdDate,\n );\n }\n // return $data;\n @\\Excel::create('Resource_Category', function ($excel) use ($data) {\n\n // Set the title\n $excel->setTitle('Resource Category Sheet');\n\n // Chain the setters\n $excel->setCreator('Seraikela')->setCompany('Seraikela');\n\n $excel->sheet('Fees', function ($sheet) use ($data) {\n $sheet->freezePane('A3');\n $sheet->mergeCells('A1:I1');\n $sheet->fromArray($data, null, 'A1', true, false);\n $sheet->setColumnFormat(array('I1' => '@'));\n });\n })->download('xls');\n }",
"public function export_Excel_Asset_SubCategory()\n {\n $data = array(1 => array(\"Resource Sub Catagory-Sheet\"));\n $data[] = array('Sl.No.', 'Sub Category Name', 'Sub Category Description', 'Category Name', 'Date');\n\n $items = asset_subcat::leftjoin('asset_cat', 'asset_subcat.asset_cat_id', '=', 'asset_cat.asset_cat_id')\n ->select(\n 'asset_subcat.asset_sub_id as slId',\n 'asset_subcat.asset_sub_cat_name',\n 'asset_subcat.asset_sub_cat_description',\n 'asset_cat.asset_cat_name',\n 'asset_subcat.created_at as createdDate'\n )->orderBy('asset_subcat.asset_sub_id', 'desc')->get();\n\n foreach ($items as $key => $value) {\n $value->createdDate = date('d/m/Y', strtotime($value->createdDate));\n $data[] = array(\n $key + 1,\n $value->asset_sub_cat_name,\n $value->asset_sub_cat_description,\n $value->asset_cat_name,\n $value->createdDate\n );\n }\n \\Excel::create('ResourceSubCatagory', function ($excel) use ($data) {\n\n // Set the title\n $excel->setTitle('ResourceSubCatagory-Sheet');\n\n // Chain the setters\n $excel->setCreator('Seraikela')->setCompany('Seraikela');\n\n $excel->sheet('Fees', function ($sheet) use ($data) {\n $sheet->freezePane('A3');\n $sheet->mergeCells('A1:I1');\n $sheet->fromArray($data, null, 'A1', true, false);\n $sheet->setColumnFormat(array('I1' => '@'));\n });\n })->download('xls');\n }",
"public function exportProductsExcelAction()\n {\n if (!$category = $this->_initCategory(true,true)) {\n return;\n }\n $fileName = 'products_by_category('.$category->getName().').csv';\n $grid = $this->getLayout()->createBlock('adminhtml/catalog_category_tab_product');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"function ExportCatalogToExcelXML()\n {\n $q = \"SELECT `\".TblModCatalogProp.\"`.*, `\".TblModCatalogPropSprName.\"`.`name` AS `prod_name`, `\".TblModCatalogSprName.\"`.`name` AS `cat_name`\n FROM `\".TblModCatalogProp.\"`, `\".TblModCatalogPropSprName.\"`, `\".TblModCatalogSprName.\"`, `\".TblModCatalog.\"`\n WHERE `\".TblModCatalogProp.\"`.`id_cat`=`\".TblModCatalog.\"`.`id`\n AND `\".TblModCatalog.\"`.`id`=`\".TblModCatalogSprName.\"`.`cod`\n AND `\".TblModCatalogSprName.\"`.`lang_id`='\"._LANG_ID.\"'\n AND `\".TblModCatalogProp.\"`.`id`=`\".TblModCatalogPropSprName.\"`.`cod`\n AND `\".TblModCatalogPropSprName.\"`.`lang_id`='\"._LANG_ID.\"'\n \";\n if( !empty($this->id_cat) ) $q .= \" AND `\".TblModCatalog.\"`.`id`='\".$this->id_cat.\"'\"; \n $q .= \" ORDER BY `\".TblModCatalog.\"`.`move` asc, `\".TblModCatalogProp.\"`.`move` asc\";\n $res = $this->db->db_Query($q);\n //echo '<br>$q='.$q.' $res='.$res.' $this->db->result='.$this->db->result;\n if( !$res OR !$this->db->result) return false;\n $rows = $this->db->db_GetNumRows();\n //echo '<br>$rows='.$rows;\n \n for($i=0;$i<$rows;$i++){ \n $row_data = $this->db->db_FetchAssoc();\n $index1 = stripslashes($row_data['id']);\n $arr_prod[$index1]=$row_data;\n } \n $filename = 'catalog.xls'; \n \n $doc = new SimpleXMLElement( \n '<?phpphpxml version=\"1.0\" encoding=\"utf-8\"?>\n <Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" \n xmlns:o=\"urn:schemas-microsoft-com:office:office\" \n xmlns:x=\"urn:schemas-microsoft-com:office:excel\" \n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" \n xmlns:html=\"http://www.w3.org/TR/REC-html40\"></Workbook>' \n ); \n \n //<Worksheet ss:Name=\"Sheet1\"> \n $worksheetNode = $doc->addChild('Worksheet'); \n \n $worksheetNode['ss:Name'] = 'Каталог товаров'; \n \n $worksheetNode->Table = '';//add a child with value '' by setter \n \n //<Row> Header\n $row = $worksheetNode->Table->addChild('Row'); \n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_ID'].' ('.$this->multi['FLD_CATEGORY'].')'); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_CATEGORY']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_ID']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n if ( isset($this->settings['name']) AND $this->settings['name']=='1' ) { \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_NAME']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n }\n \n if ( isset($this->settings['number_name']) AND $this->settings['number_name']=='1' ) { \n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($this->multi['FLD_NUMBER_NAME']); \n $cell->Data['ss:Type'] = 'String';\n }\n \n if ( isset($this->settings['price']) AND $this->settings['price']=='1' ) {\n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($this->multi['FLD_PRICE']); \n $cell->Data['ss:Type'] = 'String';\n }\n \n foreach($arr_prod as $id=>$arr_prod2){\n //<Row> Products details\n $row = $worksheetNode->Table->addChild('Row'); \n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($arr_prod2['id_cat']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($arr_prod2['cat_name']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($arr_prod2['id']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n \n if ( isset($this->settings['name']) AND $this->settings['name']=='1' ) {\n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($arr_prod2['prod_name']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n }\n \n if ( isset($this->settings['number_name']) AND $this->settings['number_name']=='1' ) { \n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($arr_prod2['number_name']); \n $cell->Data['ss:Type'] = 'String';\n }\n \n if ( isset($this->settings['price']) AND $this->settings['price']=='1' ) {\n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($arr_prod2['price']); \n $cell->Data['ss:Type'] = 'String';\n }\n }//end foreach by products \n \n $uploaddir = SITE_PATH.'/export'; \n if ( !file_exists ($uploaddir) ) mkdir($uploaddir,0777); \n else @chmod($uploaddir,0777);\n $res = $doc->asXML($uploaddir.'/'.$filename);\n @chmod($uploaddir,0755);\n \n $path = '/export/'.$filename;\n $path_show = 'http://'.NAME_SERVER.$path;\n \n if($path){\n echo 'Скачать каталог <a href=\"http://'.NAME_SERVER.'/modules/mod_catalog/report_download.php?path='.$path.'&module='.$this->module.'&task='.$this->task.'\">'.$path_show.'</a>';\n return true; \n }\n else{\n echo 'Ошибка. Каталог не экспортировался';\n return false;\n }\n \n }",
"function exportCategories($export)\n{\n\t$shop_data\t\t= $export->sSettings();\n\t$category_tree\t= $export->sCategoryTree();\n\t$categories\t\t= $export->sCategories();\n\t\n\t$xmlString = '<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n\t\t<categories>';\n\t\n\t//Hier werden die Kategorien für den Export verarbeitet\n\tforeach ($categories as $categorie)\n\t{\n\t\t//anpassen der parentID nur für die Hauptkategorien muss gemacht werden damit der baum in der auftaucht\n\t\t$categorie['parentID'] = (int) $categorie['parentID'];\n\t\t\n\t\tif($categorie['parentID'] == 1)\n\t\t{\n\t\t\t$categorie['parentID'] = 0;\n\t\t}\n\t\t\n\t\t$xmlString .='<categorie>'.\n\t\t\t'<categories_id>'.$categorie['categoryID'].'</categories_id>'.\n\t\t\t'<parent_id>'. $categorie['parentID'].'</parent_id>'.\n\t\t\t'<categories_status>'.$categorie['active'].'</categories_status>'.\n\t\t\t'<categories_name>'. $categorie['description'] .'</categories_name>' .\n\t\t\t'</categorie>';\n\t}\n\t$xmlString .= '</categories>\n\t\t\t\t\t<tax_classes>';\n\t\n\t//Hier werden die Steuerklassen verarbeitet\n\tforeach($shop_data['tax'] as $id => $values)\n\t{\n\t\t$xmlString .= '<tax_class>' .\n\t\t\t\t\t\t'<tax_rates_id>'. $id .'</tax_rates_id>' .\n\t\t\t\t\t\t'<tax_class_id>'. $id .'</tax_class_id>' .\n\t\t\t\t\t\t'<tax_rate>'. $values['tax'] .'</tax_rate>' .\n\t\t\t\t\t\t'<tax_description>'. $values['description'] .'</tax_description>' .\n\t\t\t\t\t\t'<tax_class_description>'. $values['description'] .'</tax_class_description>' .\n\t\t\t\t\t\t'<tax_class_title>'. $values['description'] .'</tax_class_title>' .\n\t\t\t\t\t'</tax_class>';\n\t}\n\t\n\t$xmlString .= \"</tax_classes>\n\t\t\t\t\t<manufacturers>\";\n\n\tforeach($shop_data['manufacturers'] as $id => $manufacturer)\n\t{\n\t\t$xmlString .= '<manufacturer>' .\n\t\t\t\t\t\t'<manufacturer_id>'. $id .'</manufacturer_id>'.\n\t\t\t\t\t\t'<manufacturer_name>'. $manufacturer .'</manufacturer_name>'.\n\t\t\t\t\t'</manufacturer>';\n\t}\n\t\n\t$xmlString .= \"</manufacturers>\";\n\t\n\techo $xmlString;\n\t\n\t//variable um dem sript mitzuteilen das ex ein export ist\n\t$export = 'export';\n\treturn $export;\n}",
"public function export()\n {\n $categorias = DB::table('categoria')->get();\n \n //creamos el archivo y le ponemos el nombre, tambien usamos el arreglo o lista de categorias del modelo\n Excel::create('Categorias', function($excel) use($categorias) {\n \n //aqui establecemos el nombre del sheet o de la hoja de excel \n $excel->sheet('Categorias', function($sheet) use($categorias) {\n \n //aqui establecemos con el rango de celda con las que vamosa trabajor\n $sheet->mergeCells('A1:E1');\n \n //nos ubicamos enl a primera fila y accedemos a sus metodos como su fuente, el tipo de fuente, tamano etc\n $sheet->row(1, function ($row) {\n $row->setFontFamily('Comic Sans MS');\n $row->setFontSize(35);\n });\n \n //establecemos a la fila una un margen de celda de 40\n $sheet->setHeight(1, 40);\n \n // en la fila 1 nos huicamos y establecemos el titulo de la tabla\n $sheet->row(1, array('Todas las categorias'));\n \n //apartir de este rango de la celda del titulo establecemos el color de fondo que es verde y aliniamos el texto\n $sheet->cells('A1:E1', function($cells) {\n $cells->setBackground('green');\n $cells->setAlignment('center');\n });\n \n $sheet->cells('A2:E2', function($cells) {\n $cells->setBackground('#6ccbd8');\n });\n \n $sheet->setBorder('A1:E'. (count($categorias) + 2), 'thin');\n \n $sheet->appendRow(2,array('N.','Nombre','Descripcion','Utilidad','Estado'));\n \n \n $count = 3;\n $quantity = 1;\n $activos = 0;\n $inactivos = 0;\n foreach($categorias as $cat)\n {\n $estado = '';\n if($cat->condicion)\n {\n $estado = 'Activo';\n $sheet->appendRow($count,array($quantity,$cat->nombre,$cat->descripcion,($cat->utilidad . ' %'),$estado));\n $sheet->setHeight($count, 15);\n $count += 1;\n $quantity +=1;\n $activos +=1;\n }\n else\n {\n $estado = 'Inactivo';\n $sheet->appendRow($count,array($quantity,$cat->nombre,$cat->descripcion,($cat->utilidad . ' %'),$estado));\n $sheet->row($count,function($row){\n $row->setBackground('#d4514a');\n });\n $sheet->setHeight($count, 15);\n $count += 1;\n $quantity +=1;\n $inactivos +=1;\n }\n }\n \n $sheet->appendRow($count+3,array('Activos',$activos));\n $sheet->cells('A'. ($count+3) . ':B' . ($count+3), function($cells) {\n $cells->setBackground('#26f094');\n });\n \n \n // aqui van los resultados de los total de activos e inactivos asi como su desi}o del mismo \n $sheet->setBorder('A'. ($count+3) . ':B' . ($count+5), 'thin');\n \n $sheet->appendRow($count+4,array('Inactivos',$inactivos));\n \n $sheet->cells('A'. ($count+4) . ':B' . ($count+4), function($cells) {\n $cells->setBackground('#d4514a');\n });\n \n $sheet->appendRow($count+5,array('Total',($activos+$inactivos)));\n $sheet->cells('A'. ($count+5) . ':B' . ($count+5), function($cells) {\n $cells->setBackground('#feff4e');\n });\n \n \n });\n\n })->export('xls');\n }",
"public function exportcats()\n\t{\n\t\tJSession::checkToken() or jexit('Invalid Token');\n\n\t\t$this->sendHeaders(\"categories.csv\", \"text/csv\");\n\t\t$this->getModel()->getCsvcats();\n\t\tjexit();\n\t}",
"public function export(){\n $products = $this->Paginator->paginate($this->Products->find());\n\n $this->autoRender = false;\n $this->layout = false;\n $fileName = \"bookreport_\".date(\"d-m-y:h:s\").\".xls\";\n\n $headerRow = array(\"ID\", \"Title\", \"Type\", \"Description\", \"Price\", \"Rating\");\n $data = array();\n foreach ($products as $product) {\n array_push($data, array($product->id, $product->description, $product->title, $product->price, $product->rating));\n }\n //debug($data);\n ini_set('max_execution_time', 1600); //increase max_execution_time to 10 min if data set is very large\n $fileContent = implode(\"\\t \", $headerRow).\"\\n\";\n foreach($data as $result) {\n $fileContent .= implode(\"\\t \", $result).\"\\n\";\n }\n header('Content-type: application/ms-excel'); /// you can set csv format\n header('Content-Disposition: attachment; filename='.$fileName);\n echo $fileContent;\n }",
"public function export(Request $request)\n {\n $category_id = $request->input('category_id', 0);\n $procurement_type = $request->input('procurement_type', null);\n $mrp_type = $request->input('mrp_type', null);\n $stock_control = $request->input('stock_control', -1);\n $min_stock = $request->input('min_stock', 0);\n\n $products = $this->indexQueryRaw( $request )->get();\n\n // Lets get dirty!!\n\n // Initialize the array which will be passed into the Excel generator.\n $data = [];\n\n $ribbon1 = $category_id > 0 ? optional(Category::find($category_id))->name : 'todos';\n $ribbon2 = $procurement_type == '' ? 'todos' : $procurement_type;\n $ribbon3 = $mrp_type == '' ? 'todos' : $mrp_type;\n $ribbon4 = $stock_control < 0 ? 'todos' : ($stock_control == 1 ? 'Sí' : 'No');\n\n // Sheet Header Report Data\n $data[] = [Context::getContext()->company->name_fiscal];\n $data[] = ['Productos sin Stock :: ', '', '', '', '', '', '', '', '', date('d M Y H:i:s')];\n $data[] = ['Categorías: '.$ribbon1];\n $data[] = ['Aprovisionamiento: '.$ribbon2];\n $data[] = ['Planificación: '.$ribbon3];\n $data[] = ['Control de Stock: '.$ribbon4];\n $data[] = ['Stock Mínimo: '.$min_stock];\n\n $data[] = [''];\n\n\n // Define the Excel spreadsheet headers\n/*\n l('Reference'), l('Product Name'), l('Main Supplier'), l('Procurement type'), l('MRP type'), l('Stock Control'),\n\n l('Stock'), l('Allocated'), l('On Order'), l('Available'), \n l('Re-Order Point'), l('Maximum stock'), l('Suggested Quantity'), l('Measure Unit'),\n\n ];\n*/\n $header_names = [\n\n l('Reference'), l('Product Name'), l('Main Supplier'), l('Procurement type'), l('MRP type'), l('Stock Control'),\n\n l('Stock'), \n l('Re-Order Point'), l('Maximum stock'), l('Measure Unit'),\n\n ];\n\n $data[] = $header_names;\n\n foreach ($products as $product) \n {\n $supplier_label = '';\n if ( $product->procurement_type == 'purchase' && $product->mainsupplier )\n $supplier_label = '['.$product->mainsupplier->id .'] '.$product->mainsupplier->name_fiscal;\n\n $row = [];\n $row[] = (string) $product->reference;\n $row[] = $product->name;\n $row[] = $supplier_label;\n $row[] = $product->procurement_type;\n $row[] = $product->mrp_type;\n $row[] = (string) $product->stock_control;\n\n $row[] = $product->quantity_onhand *1.0;\n// $row[] = (float) $product->quantity_allocated;\n// $row[] = $product->quantity_onorder *1.0;\n// $row[] = $product->quantity_available *1.0;\n\n $row[] = $product->reorder_point * 1.0;\n $row[] = $product->maximum_stock * 1.0;\n// $row[] = (float) $product->quantity_reorder_suggested;\n $row[] = $product->measureunit->sign;\n \n $data[] = $row;\n\n }\n\n\n $styles = [\n 'A2:A2' => ['font' => ['bold' => true]],\n 'A9:N9' => ['font' => ['bold' => true]],\n ];\n\n $columnFormats = [\n 'A' => NumberFormat::FORMAT_TEXT,\n// 'E' => NumberFormat::FORMAT_DATE_DDMMYYYY,\n 'C' => NumberFormat::FORMAT_NUMBER,\n 'D' => NumberFormat::FORMAT_NUMBER_00,\n 'E' => NumberFormat::FORMAT_NUMBER_00,\n 'F' => NumberFormat::FORMAT_NUMBER_00,\n 'G' => NumberFormat::FORMAT_NUMBER_00,\n ];\n\n $merges = ['A1:B1', 'A2:B2'];\n\n $sheetTitle = 'Productos sin Stock';\n\n $export = new ArrayExport($data, $styles, $sheetTitle, $columnFormats, $merges);\n\n $sheetFileName = $sheetTitle;\n\n // Generate and return the spreadsheet\n return Excel::download($export, $sheetFileName.'.xlsx');\n\n }",
"public function exportCsv(){\n $data = array(\n array(\"Viande\", \"Morceau\", \"label\", \"Colisage\", \"Qté\")\n );\n foreach ($this->cumulated_products as $product){\n $row = array(\n $product['category'],\n $product['product_name'],\n $product['label_name'],\n $product['description_short'],\n $product['quantity']\n );\n $data[] = $row;\n }\n //Tools::testVar($data);\n //download\n Tools::downloadCsv($data);\n }",
"public function exportExcelAction()\n {\n $fileName = 'curriculum.xls';\n $content = $this->getLayout()->createBlock('bs_traininglist/adminhtml_curriculum_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function exportMembersInventoryToExcel()\n {\n\n Excel::create('Member Shares',\nfunction($excel)\n{\n $excel->sheet('Members With Inventory',\n function($sheet)\n {\n $members = Member::with('inventory')\n \n ->get();\n \n $sheet->loadView('reports.inventory.membersWithInventory',array('members'=>$members,'title'=>'Members With Inventory'));\n \n });\n})->export('xls');\n }",
"public function exportExcelAction(){\n $fileName = 'magazine.xls';\n $content = $this->getLayout()->createBlock('unideal_topads/adminhtml_magazine_grid')->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function export (){\n $type = I('type',1,'intval');\n // 工厂内\n if($type == 1){\n $product_list = M('product')->where(['is_where'=>1])->select();\n $header = [\"箱子属性\",\"箱子编号\",\"入库时间\"];\n $data = [];\n foreach($product_list as $product){\n $data[] = [$product['cate_name'],$product['name'],date(\"Y-m-d H:i\", $product['update_time'])];\n }\n return $this->exportCsv($header, $data,date(\"Y-m-d-\").\"工厂内\");\n }\n\n if($type == 2){\n $product_list = M('product')->where(['is_where'=>2])->order(\"cate_name, client_id\")->select();\n $header = [\"箱子属性\",\"箱子编号\",\"客户代码\",\"出库时间\"];\n $data = [];\n foreach($product_list as $product){\n $data[] = [$product['cate_name'], $product['name'],$product['client_name'],date(\"Y-m-d H:i\", $product['update_time'])];\n }\n return $this->exportCsv($header, $data,date(\"Y-m-d-\").\"工厂外\");\n }\n }",
"function ExportCatalogTreeToExcelXML()\n {\n $this->tree = $this->loadTreeList();\n //print_r($this->tree); \n \n $q = \"SELECT `\".TblModCatalogProp.\"`.*, `\".TblModCatalogPropSprName.\"`.`name` AS `prod_name`, `\".TblModCatalogSprName.\"`.`name` AS `cat_name`\n FROM `\".TblModCatalogProp.\"`, `\".TblModCatalogPropSprName.\"`, `\".TblModCatalogSprName.\"`, `\".TblModCatalog.\"`\n WHERE `\".TblModCatalogProp.\"`.`id_cat`=`\".TblModCatalog.\"`.`id`\n AND `\".TblModCatalog.\"`.`id`=`\".TblModCatalogSprName.\"`.`cod`\n AND `\".TblModCatalogSprName.\"`.`lang_id`='\"._LANG_ID.\"'\n AND `\".TblModCatalogProp.\"`.`id`=`\".TblModCatalogPropSprName.\"`.`cod`\n AND `\".TblModCatalogPropSprName.\"`.`lang_id`='\"._LANG_ID.\"'\n \";\n if( !empty($this->id_cat) ) $q .= \" AND `\".TblModCatalog.\"`.`id`='\".$this->id_cat.\"'\"; \n $q .= \" ORDER BY `\".TblModCatalog.\"`.`move` asc, `\".TblModCatalogProp.\"`.`move` asc\";\n $res = $this->db->db_Query($q);\n //echo '<br>$q='.$q.' $res='.$res.' $this->db->result='.$this->db->result;\n if( !$res OR !$this->db->result) return false;\n $rows = $this->db->db_GetNumRows();\n //echo '<br>$rows='.$rows;\n \n for($i=0;$i<$rows;$i++){ \n $row_data = $this->db->db_FetchAssoc();\n $index1 = stripslashes($row_data['id_cat']);\n $index2 = stripslashes($row_data['id']);\n $this->arr_prod[$index1][$index2]=$row_data;\n }\n //print_r($arr_prod);\n \n \n $filename = 'catalog.xls'; \n \n $this->doc = new SimpleXMLElement( \n '<?phpphpxml version=\"1.0\" encoding=\"utf-8\"?>\n <Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" \n xmlns:o=\"urn:schemas-microsoft-com:office:office\" \n xmlns:x=\"urn:schemas-microsoft-com:office:excel\" \n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" \n xmlns:html=\"http://www.w3.org/TR/REC-html40\"></Workbook>' \n ); \n \n //<Worksheet ss:Name=\"Sheet1\"> \n $this->worksheetNode = $this->doc->addChild('Worksheet'); \n \n $this->worksheetNode['ss:Name'] = $this->Conv('Каталог продукции'); \n \n $this->worksheetNode->Table = '';//add a child with value '' by setter \n\n //<Row> Header\n $row = $this->worksheetNode->Table->addChild('Row');\n \n $cell = $row->addChild('Cell'); \n $cell->Data = 'Категория'; //shorthand \n $cell->Data['ss:Type'] = \"String\";\n \n $cell = $row->addChild('Cell'); \n $cell->Data = ''; //shorthand \n $cell->Data['ss:Type'] = \"String\";\n \n $cell = $row->addChild('Cell'); \n $cell->Data = ''; //shorthand \n $cell->Data['ss:Type'] = \"String\";\n \n $cell = $row->addChild('Cell'); \n $cell->Data = ''; //shorthand \n $cell->Data['ss:Type'] = \"String\";\n \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_ID']); //shorthand \n $cell->Data['ss:Type'] = \"String\";\n \n if ( isset($this->settings['name']) AND $this->settings['name']=='1' ) { \n $cell = $row->addChild('Cell'); \n $cell->Data = $this->Conv($this->multi['FLD_NAME']); //shorthand \n $cell->Data['ss:Type'] = 'String';//shorthand\n }\n \n if ( isset($this->settings['number_name']) AND $this->settings['number_name']=='1' ) { \n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($this->multi['FLD_NUMBER_NAME']); \n $cell->Data['ss:Type'] = 'String';\n }\n \n if ( isset($this->settings['price']) AND $this->settings['price']=='1' ) {\n $cell = $row->addChild('Cell'); //shorthand\n $cell->Data = $this->Conv($this->multi['FLD_PRICE']); \n $cell->Data['ss:Type'] = 'String';\n }\n \n $this->WriteTree($this->tree);\n \n $uploaddir = SITE_PATH.'/export'; \n if ( !file_exists ($uploaddir) ) mkdir($uploaddir,0777); \n else @chmod($uploaddir,0777);\n $res = $this->doc->asXML($uploaddir.'/'.$filename);\n @chmod($uploaddir,0755);\n \n $path = '/export/'.$filename;\n $path_show = 'http://'.NAME_SERVER.$path;\n \n if($path){\n echo 'Скачать каталог <a href=\"http://'.NAME_SERVER.'/modules/mod_catalog/report_download.php?path='.$path.'&module='.$this->module.'&task='.$this->task.'\">'.$path_show.'</a>';\n return true; \n }\n else{\n echo 'Ошибка. Каталог не экспортировался';\n return false;\n }\n \n }",
"public function exportExcelAction()\n {\n $fileName = 'discount.xml';\n $grid = $this->getLayout()->createBlock('discount/adminhtml_discount_grid');\n $this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n }",
"public function exportExcelAction()\n {\n $fileName = 'coverage.xls';\n $content = $this->getLayout()->createBlock('xcentia_vendors/adminhtml_coverage_grid')\n ->getExcelFile();\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function export_lap_aging()\n\t{\n\n\t\t$branch_id = $this->uri->segment(3);\n\t\t$date = $this->uri->segment(4);\n\t\t$desc_date = substr($date,0,2).'/'.substr($date,2,2).'/'.substr($date,4,4);\n\t\t$date = substr($date,4,4).'-'.substr($date,2,2).'-'.substr($date,0,2);\n\t\tif($branch_id==\"00000\"){\n\t\t\t$branch_id = '';\n\t\t}\n\t\t$branch_data = $this->model_cif->get_branch_by_branch_id($branch_id);\n\t\t$branch_code = $branch_data['branch_code'];\n\t\t// Create new PHPExcel object\n\t\t$objPHPExcel = $this->phpexcel;\n\t\t// Set document properties\n\t\t$objPHPExcel->getProperties()->setCreator(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setLastModifiedBy(\"MICROFINANCE\")\n\t\t\t\t\t\t\t\t\t ->setTitle(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setSubject(\"Office 2007 XLSX Test Document\")\n\t\t\t\t\t\t\t\t\t ->setDescription(\"REPORT, generated using PHP classes.\")\n\t\t\t\t\t\t\t\t\t ->setKeywords(\"REPORT\")\n\t\t\t\t\t\t\t\t\t ->setCategory(\"Test result file\");\n\n\t\t$objPHPExcel->setActiveSheetIndex(0); \n\n\t\t$styleArray = array(\n \t\t'borders' => array(\n\t\t 'outline' => array(\n\t\t 'style' => PHPExcel_Style_Border::BORDER_THIN,\n\t\t 'color' => array('rgb' => '000000'),\n\t\t ),\n\t\t ),\n\t\t);\n\n\t\t/*set header*/\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('A1:Q1');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1',strtoupper($this->session->userdata('institution_name')));\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('A2:Q2');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A2',$branch_data['branch_name']);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('A3:Q3');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A3',\"Laporan Kolektibilitas\");\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('A4:Q4');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A4',\"Tanggal \".$desc_date);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:A3')->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A1:A3')->getFont()->setSize(14);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A4')->getFont()->setSize(12);\n\n\t\t/* margined cell of header title */\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('A6:A7');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A6',\"NO\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('B6:C6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B6',\"ANGGOTA\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('D6:F6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D6',\"PENCAIRAN\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('G6:H6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('G6',\"ANGSURAN\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('I6:J6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('I6',\"OUTSTANDING\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('K6:N6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('K6',\"TUNGGAKKAN\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('O6:O7');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('O6',\"KOL\");\n\t\t$objPHPExcel->getActiveSheet()->mergeCells('P6:Q6');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('P6',\"CPP\");\n\n\t\t/* unmargined cell of header title */\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B7',\"No. Rekening\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('C7',\"Nama\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D7',\"Pokok\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E7',\"Margin\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('F7',\"Tanggal\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('G7',\"Pokok\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('H7',\"Margin\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('I7',\"Pokok\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('J7',\"Margin\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('K7',\"Hari\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('L7',\"Jml\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('M7',\"Pokok\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('N7',\"Margin\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('P7',\"%\");\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('Q7',\"Nominal\");\n\t\t\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A6:Q7')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A6:Q7')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\n\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A6:Q7')->getFont()->setBold(true);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A6:Q7')->getFont()->setSize(10);\n\t\t\n\t\t/* set border header title */\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A6:A7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B6:C6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D6:F6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('G6:H6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('I6:J6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('K6:N6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('O6:O7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('P6:Q6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('P6:Q6')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('B7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('C7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('F7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('G7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('H7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('I7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('J7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('K7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('L7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('M7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('N7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('P7')->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('Q7')->applyFromArray($styleArray);\n\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(4);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(16);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(4);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('L')->setWidth(4);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('M')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('N')->setWidth(13);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('O')->setWidth(5);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('P')->setWidth(5);\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('Q')->setWidth(13);\n\n\t\t/**\n\t\t* [BEGIN] INSERT DATA TO CELL\n\t\t*/\n\n\t\t$data = $this->model_laporan_to_pdf->get_laporan_par_terhitung($date,$branch_code);\n\t\t$no = 0;\n\t\t$row = 7;\n\n\t\t/* declare total */\n\t\t$total_pokok=0;\n\t\t$total_margin=0;\n\t\t$total_saldo_pokok=0;\n\t\t$total_saldo_margin=0;\n\t\t$total_tunggakan_pokok=0;\n\t\t$total_tunggakan_margin=0;\n\t\t$total_cadangan_piutang=0;\n\n\t\tfor ( $i = 0 ; $i < count($data) ; $i++ )\n\t\t{\n\t\t\t$result = $data[$i];\n\t\t\t$no++;\n\t\t\t$row++;\n\n\t\t\t/* akumulasi total */\n\t\t\t$total_pokok+=$result['pokok'];\n\t\t\t$total_margin+=$result['margin'];\n\t\t\t$total_saldo_pokok+=$result['saldo_pokok'];\n\t\t\t$total_saldo_margin+=$result['saldo_margin'];\n\t\t\t$total_tunggakan_pokok+=$result['tunggakan_pokok'];\n\t\t\t$total_tunggakan_margin+=$result['tunggakan_margin'];\n\t\t\t$total_cadangan_piutang+=$result['cadangan_piutang'];\n\n\t\t\t/* set row value */\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$row,$no);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$row,$result['account_financing_no'].' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('C'.$row,$result['nama']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,number_format($result['pokok'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,number_format($result['margin'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('F'.$row,date('d-m-Y',strtotime($result['droping_date'])));\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('G'.$row,number_format($result['angsuran_pokok'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('H'.$row,number_format($result['angsuran_margin'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('I'.$row,number_format($result['saldo_pokok'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('J'.$row,number_format($result['saldo_margin'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('K'.$row,$result['hari_nunggak']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('L'.$row,$result['freq_tunggakan']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('M'.$row,number_format($result['tunggakan_pokok'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('N'.$row,number_format($result['tunggakan_margin'],0,',','.').' ');\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('O'.$row,$result['par_desc']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('P'.$row,$result['par']);\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('Q'.$row,number_format($result['cadangan_piutang'],0,',','.').' ');\n\t\t\t\n\t\t\t/* set align right for currency */\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('G'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('H'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('I'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('J'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('M'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('N'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('Q'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\n\t\t\t/* set align center */\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('F'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('K'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('L'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('O'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('P'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n\n\t\t\t/* set font size */\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':Q'.$row)->getFont()->setSize(10);\n\n\t\t\t/* set border */\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('B'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('C'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('F'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('G'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('H'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('I'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('J'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('K'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('L'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('M'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('N'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('O'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('P'.$row)->applyFromArray($styleArray);\n\t\t\t$objPHPExcel->getActiveSheet()->getStyle('Q'.$row)->applyFromArray($styleArray);\n\t\t}\n\n\t\t/**\n\t\t* [END] INSERT DATA TO CELL\n\t\t*/\n\n\t\t$row++;\n\n\t\t/**\n\t\t* [BEGIN] INSERT TOTAL DATA TO CELL\n\t\t*/\n\n\t\t/* set row value */\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('D'.$row,number_format($total_pokok,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('E'.$row,number_format($total_margin,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('I'.$row,number_format($total_saldo_pokok,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('J'.$row,number_format($total_saldo_margin,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('M'.$row,number_format($total_tunggakan_pokok,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('N'.$row,number_format($total_tunggakan_margin,0,',','.').' ');\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('Q'.$row,number_format($total_cadangan_piutang,0,',','.').' ');\n\t\t\n\t\t/* set align right for currency */\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('I'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('J'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('M'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('N'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('Q'.$row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);\n\n\t\t/* set font size */\n\t\t$objPHPExcel->getActiveSheet()->getStyle('A'.$row.':Q'.$row)->getFont()->setSize(10);\n\n\t\t/* set border */\n\t\t$objPHPExcel->getActiveSheet()->getStyle('D'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('E'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('I'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('J'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('M'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('N'.$row)->applyFromArray($styleArray);\n\t\t$objPHPExcel->getActiveSheet()->getStyle('Q'.$row)->applyFromArray($styleArray);\n\n\n\t\t/**\n\t\t* [END] INSERT TOTAL DATA TO CELL\n\t\t*/\n\n\t\t// Redirect output to a client's web browser (Excel2007)\n\t\t// Save Excel 2007 file\n\n\t\theader('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\n\t\theader('Content-Disposition: attachment;filename=\"REPORT-AGING.xlsx\"');\n\t\theader('Cache-Control: max-age=0');\n\n\t\t$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');\n\t\t$objWriter->save('php://output');\n\n\t\t// ----------------------------------------------------------------------\n\t\t// [END] EXPORT SCRIPT\n\t\t// ----------------------------------------------------------------------\n\t}",
"public function exportAll($path=null){\r\n\t\t$objPHPExcel = new PHPExcel();\r\n\t\t$data = $this->getList(1,1000);\r\n\t\t$data = $data['data'];\r\n\r\n\t\t$objPHPExcel->setActiveSheetIndex(0);\r\n\t\t$objPHPExcel->getActiveSheet()->setTitle($this->il8n['glossary_levels']['glossary_levels']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', $this->cfg->siteName.'_'.$this->il8n['normal']['exportFile']);\r\n\r\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);\r\n\t\t$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(40);\r\n\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A2', $this->il8n['glossary_levels']['word']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B2', $this->il8n['glossary_levels']['translation']);\r\n\r\n\r\n\t\t$index = 2;\r\n\t\tfor($i=0;$i<count($data);$i++){\r\n\t\t\t$index ++;\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('A'.$index, $data[$i]['word']);\r\n\t\t\t$objPHPExcel->getActiveSheet()->setCellValue('B'.$index, $data[$i]['translation']);\r\n\t\t}\r\n\t\t$objStyle = $objPHPExcel->getActiveSheet()->getStyle('A1');\r\n\t\t$objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);\r\n\t\t$objPHPExcel->getActiveSheet()->duplicateStyle($objStyle, 'A1:A'.(count($data)+1));\r\n\t\t\r\n\t\t$objPHPExcel->createSheet();\r\n\t\t$objPHPExcel->setActiveSheetIndex(1);\r\n\t\t$objPHPExcel->getActiveSheet()->setTitle($this->il8n['normal']['main']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A1', $this->il8n['subject']['subject']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B1', $this->il8n['normal']['operation']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('A2', $data[0]['subject']);\r\n\t\t$objPHPExcel->getActiveSheet()->setCellValue('B2', $this->il8n['normal']['append']);\t\t\r\n\t\t\r\n\t\t$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);\r\n\r\n\t\t$file = \"download/\".date('YmdHis').\".xls\";\r\n\t\tif($path==null){\r\n\t\t\t$path = $this->cfg->filePath.$file;\r\n\t\t}\r\n\t\t$objWriter->save($path);\r\n\t\treturn $file;\r\n\t}",
"public function exportListing($beginPeriod, $endPeriod, $lang){\r\n //echo \"endPeriod = \" . $endPeriod . \"<br/>\";\r\n \r\n // ////////////////////////////////////////////////////\r\n // Create new PHPExcel object\r\n // ////////////////////////////////////////////////////\r\n $objPHPExcel = new PHPExcel();\r\n $objPHPExcel->getProperties()->setCreator(\"Platform-Manager\");\r\n $objPHPExcel->getProperties()->setLastModifiedBy(\"Platform-Manager\");\r\n $objPHPExcel->getProperties()->setTitle(\"Animals listing\");\r\n $objPHPExcel->getProperties()->setSubject(\"Animals listing\");\r\n $objPHPExcel->getProperties()->setDescription(\"\");\r\n \r\n // ////////////////////////////////////////////////////\r\n // stylesheet\r\n // ////////////////////////////////////////////////////\r\n $styleBorderedCell = array(\r\n 'font' => array(\r\n 'name' => 'Times',\r\n 'size' => 10,\r\n 'bold' => false,\r\n 'color' => array(\r\n 'rgb' => '000000'\r\n ),\r\n ),\r\n 'borders' => array(\r\n 'outline' => array(\r\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\r\n 'color' => array(\r\n 'rgb' => '000000'),\r\n ),\r\n ),\r\n 'fill' => array(\r\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\r\n 'startcolor' => array(\r\n 'rgb' => 'ffffff',\r\n ),\r\n ),\r\n 'alignment' => array(\r\n 'wrap' => false,\r\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,\r\n ),\r\n );\r\n \r\n $styleBorderedCenteredCell = array(\r\n 'font' => array(\r\n 'name' => 'Times',\r\n 'size' => 10,\r\n 'bold' => false,\r\n 'color' => array(\r\n 'rgb' => '000000'\r\n ),\r\n ),\r\n 'borders' => array(\r\n 'outline' => array(\r\n 'style' => PHPExcel_Style_Border::BORDER_THIN,\r\n 'color' => array(\r\n 'rgb' => '000000'),\r\n ),\r\n ),\r\n 'fill' => array(\r\n 'type' => PHPExcel_Style_Fill::FILL_SOLID,\r\n 'startcolor' => array(\r\n 'rgb' => 'ffffff',\r\n ),\r\n ),\r\n 'alignment' => array(\r\n 'wrap' => false,\r\n 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,\r\n ),\r\n );\r\n \r\n // query\r\n $modelAnimal = new PsAnimal();\r\n $modelPsAnimalType = new PsType();\r\n $animalsTypes = $modelPsAnimalType->getAll(\"name\");\r\n \r\n //print_r($animalsTypes);\r\n \r\n $iter = -1;\r\n foreach ($animalsTypes as $anType){\r\n if ($anType[\"name\"] != \"--\"){\r\n $iter++;\r\n if ($iter > 0){\r\n $objPHPExcel->createSheet();\r\n }\r\n $objPHPExcel->setActiveSheetIndex($iter);\r\n $objPHPExcel->getActiveSheet()->setTitle($anType[\"name\"]);\r\n $objPHPExcel->setActiveSheetIndex($iter);\r\n $objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);\r\n\r\n $curentLine = 1;\r\n\r\n $objPHPExcel->getActiveSheet()->setCellValue('A' . $curentLine, PsTranslator::NoAnimal($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('B' . $curentLine, PsTranslator::Project($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('C' . $curentLine, PsTranslator::DateEntry($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('D' . $curentLine, PsTranslator::ExitDate($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('E' . $curentLine, PsTranslator::Lineage($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('F' . $curentLine, PsTranslator::BirthDate($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('G' . $curentLine, PsTranslator::Father($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('H' . $curentLine, PsTranslator::Mother($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('I' . $curentLine, PsTranslator::Sexe($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('J' . $curentLine, PsTranslator::Genotype($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('K' . $curentLine, PsTranslator::Supplier($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('L' . $curentLine, CoreTranslator::User($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('M' . $curentLine, PsTranslator::Sector($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('N' . $curentLine, CoreTranslator::Unit($lang));\r\n $objPHPExcel->getActiveSheet()->SetCellValue('O' . $curentLine, \"ID\");\r\n\r\n\r\n $objPHPExcel->getActiveSheet()->getStyle('A' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('B' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('C' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('D' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('E' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('F' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('G' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('H' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('I' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('J' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('K' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('L' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('M' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('N' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('O' . $curentLine)->applyFromArray($styleBorderedCell);\r\n\r\n\r\n $animalsList = $modelAnimal->getAnimalIn($beginPeriod, $endPeriod, $anType[\"id\"]);\r\n //echo \"<br/>\";print_r($animalsList); echo \"<br/>\";\r\n foreach($animalsList as $animal){\r\n $curentLine++;\r\n $objPHPExcel->getActiveSheet()->SetCellValue('A' . $curentLine, $animal[\"no_animal\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('B' . $curentLine, $animal[\"projectName\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('C' . $curentLine, $animal[\"date_entry\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('D' . $curentLine, $animal[\"date_exit\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('E' . $curentLine, $animal[\"lineage\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('F' . $curentLine, $animal[\"birth_date\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('G' . $curentLine, $animal[\"father\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('H' . $curentLine, $animal[\"mother\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('I' . $curentLine, $animal[\"sexe\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('J' . $curentLine, $animal[\"genotypage\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('K' . $curentLine, $animal[\"supplierName\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('L' . $curentLine, $animal[\"userName\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('M' . $curentLine, $animal[\"hist\"][0][\"sectorName\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('N' . $curentLine, $animal[\"hist\"][0][\"unitName\"]);\r\n $objPHPExcel->getActiveSheet()->SetCellValue('O' . $curentLine, $animal[\"id\"]); \r\n\r\n $objPHPExcel->getActiveSheet()->getStyle('A' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('B' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('C' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('D' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('E' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('F' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('G' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('H' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('I' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('J' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('K' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('L' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('M' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('N' . $curentLine)->applyFromArray($styleBorderedCell);\r\n $objPHPExcel->getActiveSheet()->getStyle('O' . $curentLine)->applyFromArray($styleBorderedCell);\r\n\r\n }\r\n }\r\n }\r\n // write excel file\r\n $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);\r\n\r\n //On enregistre les modifications et on met en téléchargement le fichier Excel obtenu\r\n header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');\r\n header('Content-Disposition: attachment;filename=\"platorm-manager-animal_listing.xlsx\"');\r\n header('Cache-Control: max-age=0');\r\n $objWriter->save('php://output');\r\n }",
"public function exportExcelAction()\n\t{\n\t\t$fileName = 'testimonials.xml';\n\t\t$grid = $this->getLayout()->createBlock('testimonials/adminhtml_testimonials_grid');\n\t\t$this->_prepareDownloadResponse($fileName, $grid->getExcelFile($fileName));\n\t}",
"function statistics_extended_export_group_resources_data($group){\n $output = new PHPExcel();\n $output->getProperties()->setCreator(elgg_get_site_entity()->name)\n ->setLastModifiedBy(elgg_get_site_entity()->name)\n ->setTitle($group->name. ' ' .elgg_echo('statistics:resources'))\n ->setSubject($group->name. ' ' .elgg_echo('statistics:resources'))\n ->setDescription($group->name. ' ' .elgg_echo('statistics:resources'));\n\n $output->setActiveSheetIndex(0);\n\n $options = array('types'=>'object',\n 'count'=>true,\n 'limit'=>50,\n \"container_guids\"=>$group->guid);\n\n $count = get_entities_by_views_counter($options);\n $options['count']=false;\n if($count>0){\n $headers = array(\"guid\",\"type\",\"title\",\"user\",\"visits\");\n $headers = statistics_extended_label_generator($headers,null,\"statistics:groups:resources:\");\n $headers=array_map('elgg_echo',$headers);\n statistics_extended_export_generate_cell($output,$headers);\n\n for($i=0,$k=2;$i<$count;$i+=50){\n $options['offset']=$i;\n $entities = get_entities_by_views_counter($options);\n if(!empty($entities)){\n foreach($entities as $entity){\n $visits = $entity->countAnnotations('views_counter');\n if($visits>0){\n for($j=0;$j<$visits;$j+=50){\n $visitors = $entity->getAnnotations(\"views_counter\", 50, $j);\n if (!empty($visitors)){\n foreach($visitors as $visitor){\n $row = array();\n $row[]=$entity->guid;\n $row[]=elgg_echo(\"statistics:label:type:\".$entity->getSubtype());\n $row[]=$entity->title;\n $row[]=$visitor->getOwnerEntity()->name;\n $row[]=$visitor->value;\n statistics_extended_export_generate_cell($output,$row,$k);\n $k++;\n }\n }\n }\n\n }\n else{\n $row = array();\n $row[]=$entity->guid;\n $row[]=elgg_echo(\"statistics:label:type:\".$entity->getSubtype());\n $row[]=$entity->title;\n $row[]=\"\";\n $row[]=0;\n statistics_extended_export_generate_cell($output,$row,$k);\n $k++;\n }\n }\n }\n }\n }\n return $output;\n}",
"function statistics_extended_export_global_resources_data(){\n $output = new PHPExcel();\n $output->getProperties()->setCreator(elgg_get_site_entity()->name)\n ->setLastModifiedBy(elgg_get_site_entity()->name)\n ->setTitle($group->name. ' ' .elgg_echo('statistics:resources'))\n ->setSubject($group->name. ' ' .elgg_echo('statistics:resources'))\n ->setDescription($group->name. ' ' .elgg_echo('statistics:resources'));\n\n $output->setActiveSheetIndex(0);\n $tools = elgg_get_config('group_tool_options');\n $items = array();\n if(is_array($tools)){\n foreach($tools as $tool){\n $tool_name = $tool->name.\"_enable\";\n if($tool->name !='activity'){\n $items=array_merge($items,statistics_extended_tool_object($tool->name));\n }\n }\n }\n\n $options = array('types'=>'object',\n 'subtypes'=>$items,\n 'count'=>true,\n 'limit'=>50);\n\n $count = get_entities_by_views_counter($options);\n $options['count']=false;\n if($count>0){\n $headers = array(\"guid\",\"group\",\"type\",\"title\",\"user\",\"visits\");\n $headers = statistics_extended_label_generator($headers,null,\"statistics:global:resources:\");\n statistics_extended_export_generate_cell($output,$headers);\n for($i=0,$k=2;$i<$count;$i+=50){\n $options['offset']=$i;\n $entities = get_entities_by_views_counter($options);\n if(!empty($entities)){\n foreach($entities as $entity){\n $visits = $entity->countAnnotations('views_counter');\n if($visits >0 ){\n for($j=0;$j<$visits;$j+=50){\n $visitors = $entity->getAnnotations(\"views_counter\", 50, $j);\n if (!empty($visitors)){\n foreach($visitors as $visitor){\n $row = array();\n $row[]=$entity->guid;\n $group = \"\";\n $container = get_entity($entity->container_guid);\n if(!empty($container) && $container instanceof ElggGroup){\n $group = $container->name;\n }\n $row[]=$group;\n $row[]=elgg_echo(\"statistics:label:type:\".$entity->getSubtype());\n $row[]=$entity->title;\n $row[]=$visitor->getOwnerEntity()->name;\n $row[]=$visitor->value;\n statistics_extended_export_generate_cell($output,$row,$k);\n $k++;\n }\n }\n }\n }\n else{\n $row = array();\n $row[]=$entity->guid;\n $group = \"\";\n $container = get_entity($entity->container_guid);\n if(!empty($container) && $container instanceof ElggGroup){\n $group = $container->name;\n }\n $row[]=$group;\n $row[]=elgg_echo(\"statistics:label:type:\".$entity->getSubtype());\n $row[]=$entity->title;\n $row[]=\"\";\n $row[]=0;\n statistics_extended_export_generate_cell($output,$row,$k);\n $k++;\n }\n }\n }\n }\n }\n return $output;\n}",
"public function export()\n {\n $supplierModel = new SupplierModel();\n $data = $supplierModel->findAll();\n\n $spreadsheet = new Spreadsheet();\n $sheet = $spreadsheet->getActiveSheet();\n\n // set width\n $sheet->getColumnDimension('A')->setAutoSize(true);\n $sheet->getColumnDimension('B')->setAutoSize(true);\n $sheet->getColumnDimension('C')->setAutoSize(true);\n $sheet->getColumnDimension('D')->setAutoSize(true);\n $sheet->getColumnDimension('E')->setAutoSize(true);\n\n // set alignment to left\n $spreadsheet\n ->getDefaultStyle()\n ->getAlignment()\n ->setHorizontal(\n \\PhpOffice\\PhpSpreadsheet\\Style\\Alignment::HORIZONTAL_LEFT\n );\n\n // set styling for header\n $gray_fill = [\n 'font' => [\n 'bold' => true,\n ],\n 'fill' => [\n 'fillType' => \\PhpOffice\\PhpSpreadsheet\\Style\\Fill::FILL_SOLID,\n 'color' => ['argb' => 'FFEFEFEF'],\n ],\n ];\n $sheet->getStyle('A1:E1')->applyFromArray($gray_fill);\n\n $sheet\n ->setCellValue('A1', 'Kode Supplier')\n ->setCellValue('B1', 'Nama Supplier')\n ->setCellValue('C1', 'Alamat Supplier')\n ->setCellValue('D1', 'Telepon Supplier')\n ->setCellValue('E1', 'Kota Supplier');\n\n foreach ($data as $k => $v) {\n $i = $k + 2;\n $sheet\n ->setCellValue('A' . $i, $v['kode_supplier'])\n ->setCellValue('B' . $i, $v['nama_supplier'])\n ->setCellValue('C' . $i, $v['alamat_supplier'])\n ->setCellValue('D' . $i, $v['telp_supplier'])\n ->setCellValue('E' . $i, $v['kota_supplier']);\n }\n\n $writer = new Xlsx($spreadsheet);\n\n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"laporan.xlsx\"');\n header('Cache-Control: max-age=0');\n\n $writer->save('php://output');\n }",
"public function all_to_excel() {\n $this->load->library('export');\n $sql = $this->photoid->get_reports();\n $filename = 'DTIS_all_photoid_'.date('Y-m-d-Hi');\n\t\t\t$this->export->to_excel($sql, $filename); \n\t\t\t\n }",
"public function index()\n {\n \n Excel::create('Articulos', function($excel) {\n \n $excel->sheet('Articulos', function($sheet) {\n \n $products = Articulo::all();\n \n $sheet->fromArray($products);\n \n });\n })->download('xls');\n \n }",
"function excel_export() {\n\t\t$this->check_action_permission('excel_export');\n\t\tini_set('memory_limit','1024M');\n\t\tset_time_limit(0);\n\t\tini_set('max_input_time','-1');\n\t\t\n\t\t\n\t\t$params = $this->session->userdata('giftcards_search_data') ? $this->session->userdata('giftcards_search_data') : array('offset' => 0, 'order_col' => 'giftcard_number', 'order_dir' => 'asc', 'search' => FALSE,'deleted' => 0);\n\t\t\n\t\t$search = $params['search'] ? $params['search'] : \"\";\n\t\t\n\t\t//Filter based on search\n\t\tif ($search)\n\t\t{\n\t\t\t$data = $this->Giftcard->search($search,$params['deleted'],$this->Giftcard->search_count_all($search),0,$params['order_col'],$params['order_dir'])->result_object();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->Giftcard->get_all($params['deleted'])->result_object();\n\t\t}\n\t\t$this->load->helper('report');\n\t\t$rows = array();\n\t\t$rows[] = $this->_excel_get_header_row();\n\t\tforeach ($data as $r) {\n\t\t\t$row = array(\n\t\t\t\t$r->giftcard_number,\n\t\t\t\t$r->description,\n\t\t\t\tto_currency_no_money($r->value),\n\t\t\t\t$r->inactive ? 'y' : '',\n\t\t\t\t$r->full_name,\n\t\t\t);\n\t\t\t$rows[] = $row;\n\t\t}\n\t\t\n\t\t$this->load->helper('spreadsheet');\n\t\tarray_to_spreadsheet($rows,'giftcards_export.'.($this->config->item('spreadsheet_format') == 'XLSX' ? 'xlsx' : 'csv'));\n\t}",
"public function exportProductExcelAction()\n {\n $fileName = 'tag_product.xml';\n $content = $this->getLayout()->createBlock('adminhtml/report_tag_product_grid')\n ->getExcelFile($fileName);\n\n $this->_prepareDownloadResponse($fileName, $content);\n }",
"public function excelcat()\n {\n return view('adm.categorias.carga', compact('categorias'));\n }",
"public function exportData()\n {\n $cmsdata = Cms::get()->toArray();\n \n $cms = array();\n if(isset($cmsdata) && count($cmsdata) > 0)\n {\n foreach ($cmsdata as $kCms => $vCms) {\n \n $vCms['content'] = strip_tags($vCms['content']);\n \n $cms[$kCms]['Id'] = $vCms['id'];\n $cms[$kCms]['Type'] = $vCms['type'];\n $cms[$kCms]['Content'] = $vCms['content'] ? $vCms['content'] : '-';\n }\n }\n Excel::create('cms', function($excel) use($cms) {\n $excel->sheet('Sheet 1', function($sheet) use($cms) {\n $sheet->fromArray($cms);\n });\n })->export('xls');\n }"
] | [
"0.7536986",
"0.71147794",
"0.6675513",
"0.6372793",
"0.63207936",
"0.6286798",
"0.6255034",
"0.6196118",
"0.6186135",
"0.6153223",
"0.60385233",
"0.60339844",
"0.6026011",
"0.5996308",
"0.59883064",
"0.58794725",
"0.58704233",
"0.5848039",
"0.57957333",
"0.5777567",
"0.5774486",
"0.576593",
"0.5765898",
"0.5727071",
"0.5708483",
"0.5703875",
"0.57028896",
"0.5692758",
"0.5685195",
"0.5684054"
] | 0.7433631 | 1 |
Condition: Entity is new | function rules_condition_entity_is_new($entity, $settings, $state, $element) {
$wrapper = $state->currentArguments['entity'];
return !$wrapper->getIdentifier() || !empty($entity->is_new);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isNewEntity()\n {\n return !isset($this->attributes['id']);\n }",
"public function isNew($entity);",
"public function isNew();",
"private function isNew($entity){\t\t\n\t\t$key = trim($entity->key);\n\t\tif (empty($key) || strcasecmp($key, 'new')==0){\n\t\t\treturn true;\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isNew(): bool;",
"public function isNew(): bool;",
"public function isNew(): bool;",
"public function getNewEntity();",
"public function isNew()\n {\n return !$this->isPersistent();\n }",
"public function isNew(): bool\n {\n return $this->getStatus() === self::STATUS_NEW;\n }",
"public function isNew()\n {\n return $this->status === self::STATUS_NEW;\n }",
"public function isNew()\n {\n return $this->status == self::STATUS_NEW;\n }",
"public function isTargetNew() {\n // If only an ID is given, the reference cannot be a new entity.\n return !isset($this->id) && isset($this->target) && $this->target->getValue()->isNew();\n }",
"public function isNew()\n {\n return !$this->getDbRecord()->exists();\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function isNew()\n {\n return $this->new;\n }",
"public function is_new() {\n return ( $this->id === null ) ? true : false;\n }",
"private function createNewEntityRequest()\n {\n //TODO: Add catch exception for Bcoin exceptions\n $endpoint = '/' . $this->persistableConfig()->create();\n\n if ($this->serializableConfig['exclude_id']) {\n $this->connection->put($endpoint, $this->toJson());\n } else {\n $this->id = $this->connection->put($endpoint, $this->toJson());\n }\n\n return TRUE;\n }",
"public function isNew()\n {\n return $this->getId() ? false : true;\n }",
"public function isNew(): bool\n {\n return $this->isNew;\n }",
"public function isNew(): bool\n {\n return $this->isNew;\n }",
"public function isNew(): bool\n {\n return $this->isNew;\n }",
"public function isNewRevision();",
"public function isNew() {\n\t\treturn $this->_new;\n\t}",
"public function isNew(){\n return (null === $this->id);\n }",
"public function isNew()\n {\n return $this->isNew;\n }"
] | [
"0.77141416",
"0.75309837",
"0.7504878",
"0.74207044",
"0.7258337",
"0.7258337",
"0.7258337",
"0.71917963",
"0.6986196",
"0.68478596",
"0.68365645",
"0.68130577",
"0.67787397",
"0.6667547",
"0.66116524",
"0.66116524",
"0.66116524",
"0.66116524",
"0.66116524",
"0.66116524",
"0.65663886",
"0.6553277",
"0.6527681",
"0.65185523",
"0.65185523",
"0.65185523",
"0.651327",
"0.65039086",
"0.64996773",
"0.6486852"
] | 0.7868484 | 0 |
Condition: Entity has field. | function rules_condition_entity_has_field($entity, $field_name, $settings, $state) {
$wrapper = $state->currentArguments['entity'];
return isset($wrapper->$field_name) || isset($entity->$field_name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasField($field);",
"public function hasField($field);",
"public function hasField($name);",
"public function hasCondition(){\n return $this->_has(3);\n }",
"public function hasField($field) \n\t{\n\t\t$existing = parent::hasField($field); \n\t\t// $val = $this->__get($field);\n\t\t// return !empty($val);\n\t\treturn $existing || ($this->cmisObject ? $this->cmisObject->hasProperty($field) : false);\n\t}",
"function fieldHasValue($project, $record, $field, $event) {\n $fields = \\REDCap::getData($project, 'array', $record, $field, $event);\n return !empty($fields[$record][$event][$field]);\n}",
"public function hasField(string $name) : bool;",
"public function hasField($field) {\n return array_key_exists($field, $this->json_attributes) || in_array($field, $this->fillable) || array_key_exists($field, $this->attributes);\n }",
"public function testHasField()\n {\n $this->assertFalse($this->uut->hasField('void'));\n\n $this->uut->setData(self::SOME_DATA);\n $this->assertTrue($this->uut->hasField('foo'));\n $this->assertFalse($this->uut->hasField('faa'));\n }",
"public function __isset($field) {\r\n\t\t\r\n\t\tif($field == 'primary_key') return isset($this->fields[static::getPrimaryKey()]);\r\n\t\treturn isset($this->fields[$field]) ? true : (isset($this->related[$field]) ? true : isset($this->$field));\r\n\t\t\r\n\t}",
"public function hasField($field)\n {\n if (! empty($this->fields[$field])) {}\n }",
"public function hasField($key){ return !empty($this->field_map[$key]); }",
"public function hasField($key){ return !empty($this->field_map[$key]); }",
"function __isset($field){\n\n return isset($this->_data[$field]);\n\n }",
"public function isFilled() {\n\t $fields = $this->entity ? $this->entity->getAll() : array();\n\t \n\t \treturn !empty($fields);\n\t }",
"public function hasFields(){ return !empty($this->field_map); }",
"public function hasFields(){ return !empty($this->field_map); }",
"public function has($field) : bool\n {\n return $this->row->has($field)\n || $this->related->has($field);\n }",
"public function check_field() {\n\t\t\t\n\t\t\tif ( isset( $this->field->name ) && isset( $this->field->type ) && isset( $this->field->title ) ) return true;\n\t\t\t\n\t\t\treturn false;\n\t\t\t\n\t\t}",
"public function hasFieldInfo($field_name);",
"public function getEntityField();",
"function fieldExists($field);",
"public function hasFieldData()\n {\n return true;\n }",
"public function _fieldExists($table,$field)\n\t{\n\t\treturn true;\n\t}",
"public function hasEntityKey(){\n return $this->_has(1);\n }",
"public function hasFields()\n {\n return count($this->fields) > 0;\n }",
"public function hasFields()\n {\n return isset($this->fields);\n }",
"public function authorize()\n {\n /** @var GameField $field */\n $field = GameField::find($this->route()->parameter('field_id'));\n\n return isset($field);\n }",
"public function hasFields()\n {\n return null !== @$this->fields;\n }",
"public function hasProperty(){\n return $this->_has(1);\n }"
] | [
"0.6755754",
"0.6755754",
"0.6607945",
"0.6563613",
"0.649797",
"0.63836986",
"0.6333832",
"0.63323104",
"0.6277378",
"0.6267061",
"0.6245906",
"0.62315375",
"0.62315375",
"0.6227775",
"0.6204969",
"0.61443985",
"0.61443985",
"0.60773396",
"0.6065404",
"0.604185",
"0.60360146",
"0.6025032",
"0.5974802",
"0.58877474",
"0.5860219",
"0.5846402",
"0.5819035",
"0.5818655",
"0.5801789",
"0.5797622"
] | 0.76521707 | 0 |
Using in dashborad view. Rendering progress bar for each of rows | public function jobProgressBar($data, $row) {
$progressCalculator = new ProgressCalculator();
$percentage = $progressCalculator->getTotalProgressForJob($data);
$this->renderPartial('_progressBar', array(
'percentage' => $percentage,
'row' => $row,
'progressPrefix' => 'jobs',
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function progress_bar(){\n\t\t$data['progress'] = $this->Dashboard_model->progress_bar();\n\t\t$this->load->template('progress_bar',$data);\n\t}",
"public function viewProgress()\n \t{\n \t\treturn view('progress');\n \t}",
"function renderShowProgressDivs() \r\n{\r\n\tglobal $lang;\r\n\tprint\tRCView::div(array('id'=>'working'),\r\n\t\t\t\tRCView::img(array('src'=>'progress_circle.gif')) . RCView::SP .\r\n\t\t\t\t$lang['design_08']\r\n\t\t\t) .\r\n\t\t\tRCView::div(array('id'=>'fade'), '');\r\n}",
"function create_progress_bars($i) {\n // First create our basic CSS that will control\n // the look of this bar:\n\necho \"\n<div class='text\".$i.\"'>Script Progress</div>\n<div id='barbox_a\".$i.\"'></div>\n<div class='bar\".$i.\" blank\".$i.\"'></div>\n<div class='per\".$i.\"'>0%</div>\";\n // Ensure that this gets to the screen\n // immediately:\n flush();\n}",
"public function progressIndex() {\n $homestay = Homestay::where('status', 'pending')->get();\n $souvenir = Souvenir::where('status', 'pending')->get();\n $guide = Guide::where('status', 'pending')->get();\n $art = Art::where('status', 'pending')->get();\n $rm = RM::where('status', 'pending')->get();\n $tani = Tani::where('status', 'pending')->get();\n $umkm = UMKM::where('status', 'pending')->get();\n $kendaraan = Kendaraan::where('status', 'pending')->get();\n \treturn view('admin.progress')\n ->with('homestay', $homestay)\n ->with('souvenir', $souvenir)\n ->with('guide', $guide)\n ->with('art', $art)\n ->with('rm', $rm)\n ->with('tani', $tani)\n ->with('umkm', $umkm)\n ->with('kendaraan', $kendaraan);\n }",
"public function languageProgressBar($data, $row) {\n $progressCalculator = new ProgressCalculator();\n $percentage = $progressCalculator->getForLanguage($data->project, $data->target_lang_id);\n\n $this->renderPartial('_progressBar', array(\n 'percentage' => $percentage,\n 'row' => $row,\n 'progressPrefix' => 'languages',\n ));\n }",
"public function actionUpdateProgressBar() {\n if(!Yii::app()->request->getPost('updateableIds') || !Yii::app()->request->isAjaxRequest)\n return false;\n\n $gridType = Yii::app()->request->getPost('gridType');\n\n $projectJobIds = Yii::app()->request->getPost('updateableIds');\n $response = array();\n foreach($projectJobIds as $key => $projectJobId) {\n $projectJob = ProjectJob::model()->findByPk($projectJobId);\n ob_start();\n if($gridType == 'languages')\n $this->languageProgressBar($projectJob, $key);\n elseif($gridType == 'jobs')\n $this->jobProgressBar($projectJob, $key);\n\n $response['data'][] = ob_get_clean();\n }\n\n echo CJSON::encode($response);\n }",
"abstract public function progress();",
"public function render()\n {\n return view('genealabs-laravel-multi-step-progressbar::components.multi-step-progressbar-item');\n }",
"function index()\n {\n $this->data['title'] = trans('backpack::base.dashboard'); // set the page title\n $this->data['breadcrumbs'] = [\n trans('backpack::crud.admin') => backpack_url('dashboard'),\n trans('backpack::base.dashboard') => false,\n ];\n $this->data['widgets']['before_content'] = [\n [\n 'type' => 'progress',\n 'class' => 'card text-white bg-primary mb-2',\n 'value' => '11.456',\n 'description' => 'Registered users.',\n 'progress' => 57, // integer\n 'hint' => '8544 more until next milestone.',\n 'wrapperClass' => 'col-sm-3 col-md-3',\n ],\n [\n 'type' => 'progress',\n 'class' => ' text-white bg-info mb-2',\n 'value' => '11.456',\n 'description' => 'Registered users.',\n 'progress' => 57, // integer\n 'hint' => '8544 more until next milestone.',\n 'wrapperClass' => 'col-sm-3 col-md-3',\n ],\n [\n 'type' => 'progress',\n 'class' => 'card text-white bg-primary mb-2',\n 'value' => '11.456',\n 'description' => 'Registered users.',\n 'progress' => 57, // integer\n 'hint' => '8544 more until next milestone.',\n 'wrapperClass' => 'col-sm-3 col-md-3',\n ],\n [\n 'type' => 'progress',\n 'class' => ' text-white bg-success mb-2',\n 'value' => '11.456',\n 'description' => 'Registered users.',\n 'progress' => 57, // integer\n 'hint' => '8544 more until next milestone.',\n 'wrapperClass' => 'col-sm-3 col-md-3',\n ],\n ];\n\n return view(backpack_view('dashboard'), $this->data);\n }",
"function outputProgress($current, $total,$attenuator,$phaseShifter) {\n echo \"<span style='position: absolute;z-index:$current;background:#FFF;'>\" .\"Attenuator:\".$attenuator.\" PhaseShifter:\".$phaseShifter.\" Progress:\".round($current / $total * 100) . \"% </span>\";\n myFlush();\n //sleep(1);\n}",
"private function progressBar()\n {\n $bar = $this->output->getOutput()->createProgressBar(5);\n\n $i = 0;\n\n while ($i != 5) {\n sleep(1);\n\n if ($i == 3) {\n $this->output->line(\"\\nYou're doing really hard work right now, you best believe it!\");\n }\n\n $bar->advance();\n\n $i++;\n }\n $bar->finish();\n }",
"private function draw() {\n $this->perc = floor(($this->done / $this->total) * 100);\n $bar_perc = floor(($this->done / $this->total) * $this->bar_length);\n $left = $this->bar_length - $bar_perc;\n\n $write = sprintf(\"\\033[0G\\033[2K $this->done/$this->total [%'={$bar_perc}s>%-{$left}s] - $this->perc%%\", \"\", \"\");\n if ($this->done >= $this->total) $write .= \"\\n\";\n fwrite(STDERR, $write);\n }",
"function unedtrivial_chart_overview_progress($uned,&$chart,&$table,$cmid){\n GLOBAL $CFG, $OUTPUT; \n \n $notstarted = $giveuprisk = $progressing = $completed = 0;\n unedtrivial_get_users_progress($uned,$notstarted,$giveuprisk,$progressing,$completed);\n $all = $notstarted+$giveuprisk+$progressing+$completed;\n $progressing = $progressing + $giveuprisk; //\"Give up risk\" will be absorbed by \"Progressing\"\n $all = max(1,$all);\n //Generate table\n $table = new html_table();\n $table->head = array('','','','');\n $bMail = new single_button(new moodle_url('teacheroptions.php', \n array('id' => $cmid, 'option' => '3','destiny' => '2')),\n get_string('overviewchart1button','unedtrivial'));\n $table->data[] = array(get_string('overviewchart1o1','unedtrivial'),$notstarted,\n round($notstarted/$all*100).\"%\",\n \"<center>\".$OUTPUT->render($bMail).\"</center>\");\n $bMail = new single_button(new moodle_url('teacheroptions.php', \n array('id' => $cmid, 'option' => '3','destiny' => '4')),\n get_string('overviewchart1button','unedtrivial'));\n $table->data[] = array(get_string('overviewchart1o3','unedtrivial'),$progressing,\n round($progressing/$all*100).\"%\",\n \"<center>\".$OUTPUT->render($bMail).\"</center>\");\n $bMail = new single_button(new moodle_url('teacheroptions.php', \n array('id' => $cmid, 'option' => '3','destiny' => '5')),\n get_string('overviewchart1button','unedtrivial'));\n $table->data[] = array(get_string('overviewchart1o4','unedtrivial'),$completed,\n round($completed/$all*100).\"%\",\n \"<center>\".$OUTPUT->render($bMail).\"</center>\");\n //Generate chart (if Moodle version is 3.2 or upper)\n if (substr($CFG->version,0,8) >= \"20161205\"){\n $chart = new \\core\\chart_pie();\n $CFG->chart_colorset = ['#5c626d', '#09bcd8', '#09ba15'];\n $series = new core\\chart_series(get_string('participantstab','unedtrivial'),\n [$notstarted,$progressing,$completed]);\n $chart->add_series($series);\n $chart->set_labels(array(get_string('overviewchart1o1','unedtrivial'),\n// get_string('overviewchart1o2','unedtrivial'),\n get_string('overviewchart1o3','unedtrivial'),\n get_string('overviewchart1o4','unedtrivial')));\n }\n}",
"function displayProgress($CPObtained, $CPRequired, $noOfAttemptedUnits, $fullyCompletedUnits, $currentCourseAvg, $statusOfCourse)\n {\n?>\n <!-- Display Progress -->\n <div class = \"progressDetails\">\n <table width = \"500\" align =\"center\">\n <tr>\n <td width = \"400\">Credit Points Required: </td>\n <td><?php echo \"$CPRequired\"; ?></td>\n </tr>\n <tr>\n <td>Total Passed Credit Points: </td>\n <td><?php echo \"$CPObtained\"; ?></td>\n </tr>\n <tr>\n <td>No. of Units Attempted: </td>\n <td><?php echo \"$noOfAttemptedUnits\"; ?></td>\n </tr>\n <tr>\n <td>No. of Units Successfully Completed: </td>\n <td><?php echo \"$fullyCompletedUnits\"; ?></td>\n </tr>\n <tr>\n <td> </td>\n <td> </td>\n </tr>\n <tr>\n <td>Course Average: </td>\n <td><?php echo \"$currentCourseAvg\"; ?></td>\n </tr>\n <tr>\n <td>Course Status: </td>\n <td width = 500><?php echo \"$statusOfCourse\"; ?></td>\n </tr>\n </table>\n </div>\n<?php\n }",
"function get_progress_bar($p, $width, $sectionid = 0) {\r\n\t\t$result = \r\n\t\t\t\thtml_writer::tag('div',\r\n\t\t\t\t html_writer::tag('div', \r\n\t\t\t\t\thtml_writer::tag('div', \r\n\t\t\t\t\t\t'', \r\n\t\t\t\t\t\tarray('style' => 'width: '.$p.'%; height: 15px; border: 0px; background: #9ADC00; text-align: center; float: left;', 'id' => 'oc-progress-'.$sectionid)\r\n\t\t\t\t\t), \r\n\t\t\t\t\tarray('style' => 'width: '.$width.'%; height: 15px; border: 1px; background: #aaa; solid #aaa; margin: 0; padding: 0; float: left; position: absolute;')\r\n\t\t\t\t ).\r\n\t\t\t\t html_writer::tag('div', $p.'%', array('style' => 'float: right; padding: 0; position: absolute; color: #555; width: 100%; text-align: center;', 'id' => 'oc-progress-text-'.$sectionid)).\r\n\t\t\t\t html_writer::tag('div', '', array('style' => 'clear: both;')),\r\n\t\t\t\tarray('class' => 'oc-progress-div', 'style' => 'float: left; position: relative;'));\r\n\t\treturn $result;\r\n\t}",
"public function progressBarCommand()\n {\n $i = 0;\n $total = 120;\n $bar = new ProgressBar();\n $bar->start(120);\n\n while ($i <= $total) {\n $bar->advance();\n usleep(50000);\n $i++;\n }\n\n $bar->finish();\n }",
"function barLabels($data,$config,$label){\n $id=$config['id'];\n $width=$config['width'];\n $height=$config['height'];\n $bgURL=$config['bgURL'];\n $font=$config['font'];\n $startPoint2=10;//$config['startPoint2'];\n $max1=$config['max1']-60;;\n $gap=10;//$config['gap'];\n $xgap=ceil($width/(sizeof($data)+1));//$config['xgap'];\n $wd=$config['wd'];\n $scale=$max1/100;//ceil($width/120);//$config['scale'];\n \n $b=2;\n $res=$this->create($id,$width,$height,$b);\n $res.=$this->getCanvas($id);\n $res.=$this->setFont($id,$font);\n $res.=$this->gridCanvas($id,$width,$height,$max1,$font);\n \n if(strlen($bgURL)>4)\n {\n $res.=$this->setBackground($id,$bgURL);\n $res.=$this->onload($id,$bgURL);\n }\n else\n {\n $func=$id.'_action';\n $res.=\"\n document.addEventListener('DOMContentLoaded', $func);\n function $func(){\n \";\n }\n \n \n $i=1;\n $colorNum=sizeof($this->color);\n \n foreach($data as $var){\n $l_variable=ceil($var*$scale);\n $y_variable=$max1-$l_variable;\n $startP=$startPoint2+$i*$xgap;\n $j=$i%$colorNum;//10;\n $color=$this->color[$j];\n $res.=$this->rect($id, $startP,$gap,$var,$y_variable,$wd,$l_variable,$color);\n $txt=$label[$i];\n $res.=$this->text($id, $startP,$txt,$max1,$font);\n $i++;\n }\n $res.=$this->endScript();\n return $res;\n }",
"public function run()\n {\n $rows = [];\n $i = 0;\n foreach ($this->attributes as $attribute) {\n $rows[] = $this->renderAttribute($attribute, $i++);\n }\n\n $options = $this->options;\n $tag = ArrayHelper::remove($options, 'tag', 'table');\n echo Html::tag($tag, implode(\"\\n\", $rows), $options);\n }",
"function dgu_data_set_request_progress_render($subtype, $conf, $panel_args, $context) {\n $block = new stdClass();\n $query = db_select('field_data_field_review_outcome', 'o');\n $query->join('field_data_field_review_status', 's', 's.entity_id = o.entity_id');\n $query->join('node', 'n', 's.entity_id = n.nid');\n $query->fields('o', array('field_review_outcome_value'))\n ->groupBy('field_review_outcome_value')\n ->condition('n.status', NODE_PUBLISHED)\n ->condition('field_review_status_value', 6)\n ->addExpression('COUNT(o.entity_id)', 'count');\n $result = $query->execute();\n\n $outcome_field_info = field_info_field('field_review_outcome');\n $allowed_values = list_allowed_values($outcome_field_info);\n\n $id = 'data_requests_by_outcome';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_review_outcome_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by outcome',\n 'width' => '0.49',\n 'rows' => $rows,\n );\n $block->content = d3_draw($chart);\n\n\n $query = db_select('field_data_field_review_status', 's');\n $query->join('node', 'n', 's.entity_id = n.nid');\n $query->fields('s', array('field_review_status_value'))\n ->groupBy('field_review_status_value')\n ->condition('field_review_status_value', array(1, 2, 3, 4, 5), 'IN')\n ->addExpression('COUNT(s.entity_id)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_review_status');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_status';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_review_status_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by status',\n 'width' => '0.49',\n 'rows' => $rows,\n );\n $block->content .= d3_draw($chart);\n\n $query = db_select('node', 'n');\n $query->leftJoin('field_data_field_organisation_type', 't', 't.entity_id = n.nid');\n $query->fields('t', array('field_organisation_type_value'))\n ->condition('n.type', 'dataset_request')\n ->groupBy('field_organisation_type_value')\n ->addExpression('COUNT(n.nid)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_organisation_type');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_organisation_type';\n $rows = array();\n foreach($result as $row) {\n if (empty($row->field_organisation_type_value)) {\n $rows[] = array('Private individual', $row->count, $id);\n }\n else {\n $rows[] = array($allowed_values[$row->field_organisation_type_value], $row->count, $id);\n }\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by organisation type',\n 'width' => '0.99',\n 'rows' => $rows,\n );\n $hidden = d3_draw($chart);\n\n\n $query = db_select('field_data_field_barriers_reason', 'r');\n $query->join('node', 'n', 'r.entity_id = n.nid');\n $query->fields('r', array('field_barriers_reason_value'))\n ->groupBy('field_barriers_reason_value')\n ->addExpression('COUNT(r.entity_id)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_barriers_reason');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_reason';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_barriers_reason_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by reason',\n 'width' => '0.99',\n 'rows' => $rows,\n );\n $hidden .= d3_draw($chart);\n\n $block->content .= '<div class=\"vis-hidden\" style=\"display: none;\">' . $hidden . '</div><a class=\"vis-see-more pull-right\" href=\"#\">See more</a>';\n\n return $block;\n}",
"function update_progress($percent) {\n\t\t// First let's recreate the percent with\n\t\t// the new one:\n\t\techo \"<div class='per'>{$percent}\n\t\t%</div>\\n\";\n\t\n\t\t// Now, output a new 'bar', forcing its width\n\t\t// to 3 times the percent, since we have\n\t\t// defined the percent bar to be at\n\t\t// 300 pixels wide.\n\t\techo \"<div class='bar' style='width: \",\n\t\t$percent * 3, \"px'></div>\\n\";\n\t\n\t\t// Now, again, force this to be\n\t\t// immediately displayed:\n\t\t\n\t\tflush();\n\t}",
"function create_progress() {\n\t\t// the look of this bar:\n\t\techo \"\n\t\t<style>\n\t\t#text {\n\t\tposition: absolute;\n\t\ttop: 100px;\n\t\tleft: 50%;\n\t\tmargin: 0px 0px 0px -150px;\n\t\tfont-size: 18px;\n\t\ttext-align: center;\n\t\twidth: 300px;\n\t\tcolor:#ffffff;\n\t\t\n\t}\n\t#barbox_a {\n\tposition: absolute;\n\ttop: 130px;\n\tleft: 50%;\n\tmargin: 0px 0px 0px -160px;\n\twidth: 304px;\n\theight: 24px;\n\tbackground-color: black;\n\t}\n\t.per {\n\tposition: absolute;\n\ttop: 130px;\n\tfont-size: 18px;\n\tleft: 50%;\n\tmargin: 1px 0px 0px 150px;\n\tbackground-color: #5C91C3;\n\tcolor:#ffffff;\n\t}\n\t\n\t.bar {\n\tposition: absolute;\n\ttop: 132px;\n\tleft: 50%;\n\tmargin: 0px 0px 0px -158px;\n\twidth: 0px;\n\theight: 20px;\n\tbackground-color: #0099FF;\n\t}\n\t\n\t.blank {\n\tbackground-color: white;\n\twidth: 300px;\n\t}\n\t</style>\n\t\";\n\t\n\t\t// Now output the basic, initial, XHTML that\n\t\t// will be overwritten later:\n\t\techo \"\n\t\t<div id='text'>Unosim podatke <img src='ajax-loader.gif'></div>\n\t\t<div id='barbox_a'></div>\n\t\t<div class='bar blank'></div>\n\t\t<div class='per'>0%</div>\n\t\t\";\n\t\n\t\t// Ensure that this gets to the screen\n\t\t// immediately:\n\t\t\n\t\tflush();\n\t}",
"public function getProgress()\n {\n return new Progress(array('scans_id'=> $this->id));\n }",
"function sc_progress_bars( $attr, $content = null )\n{\n\textract(shortcode_atts(array(\n\t\t'title' => '',\n\t), $attr));\n\n\n\t$output = '<div class=\"progress_bars_wrapper\">';\n\t\tif( $title ) $output .= '<h4 class=\"title\">'. $title .'</h4>';\n\t\t$output .= '<ul class=\"bars_list\">';\n\t\t\t$output .= do_shortcode( $content );\n\t\t$output .= '</ul>';\n\t$output .= '</div>'.\"\\n\";\n\n\treturn $output;\n}",
"public function run()\n {\n if( $this->columns < 1){\n $this->columns = 1;\n }\n if( $this->columns > 4){\n $this->columns = 4;\n }\n $rows = [];\n $i = 0;\n foreach ($this->attributes as $attribute) {\n $rows[] = $this->renderAttribute($attribute, $i++);\n }\n\n $options = $this->options;\n $tag = ArrayHelper::remove($options, 'tag', 'dl');\n echo Html::tag($tag, implode(\"\\n\", $rows), $options);\n }",
"public function progressAction()\n {\n\t}",
"protected function _calculatePercentForProgressBar()\n {\n $this->_currentPercentDoneWork = min(100, ceil(($this->_currentIteration / $this->_countIteration) * 100));\n }",
"public function index()\n {\n $progresses = $this->progress\n ->leftJoin('ait_resources','ait_resource_progresses.resource_id','=','ait_resources.id')\n ->leftJoin('aits','ait_resources.ait_id','=','aits.id')\n ->leftJoin('clients','aits.client_id','=','clients.id')\n ->select('ait_resource_progresses.id as id','ait_resource_progresses.date as date',\n 'ait_resource_progresses.time as time','ait_resources.process as process',\n 'ait_resource_progresses.progress as progress')\n ->get();\n $resources = AitResource::orderBy('process')->get();\n $devices = AitProgressMeans::orderBy('device')->get();\n $origins = AitProgressOrigin::orderBy('origin')->get();\n $title = $this->title;\n $list = json_encode([\n ['page'=>'Home', 'url'=>route('home')],\n ['page'=>'Recursos','url'=>'#'],\n ['page'=>'Andamentos','url'=>'#'],\n ['page'=> $title,'url'=>'']\n ]);\n\n return view('ait.resource.progress.progress.index', compact('progresses','resources','devices','origins','title','list')); \n }",
"private function PROGRESS() {\n if( $this->error ) return;\n \n // Check that a process ID was given.\n if( !isset($this->params[1]) ) {\n \n $this->__status( 400 );\n \n return;\n \n }\n \n // Set the status.\n $this->__status( 200 );\n \n // Attempt to get the progress for the given ID.\n $this->data = $this->progress->getProgress($this->params[1]);\n \n }",
"private function checklistProgress($checklists) {\n\n $progress['bar'] = 'w-0'; //css width %\n $progress['completed'] = '---';\n\n //sanity - make sure this is a valid tasks object\n if ($checklists instanceof \\Illuminate\\Pagination\\LengthAwarePaginator) {\n $count = 0;\n $completed = 0;\n foreach ($checklists as $checklist) {\n if ($checklist->checklist_status == 'completed') {\n $completed++;\n }\n $count++;\n }\n //finial\n $progress['completed'] = \"$completed/$count\";\n if ($count > 0) {\n $percentage = round(($completed / $count) * 100);\n $progress['bar'] = \"w-$percentage\";\n }\n }\n\n return $progress;\n }"
] | [
"0.6801379",
"0.610423",
"0.60429007",
"0.59547776",
"0.5925782",
"0.5827706",
"0.5760822",
"0.5748514",
"0.5562519",
"0.5556227",
"0.5499721",
"0.5495917",
"0.5490606",
"0.5450879",
"0.5449125",
"0.5443491",
"0.5435338",
"0.5402039",
"0.53844386",
"0.5384348",
"0.5367384",
"0.5364393",
"0.5312275",
"0.531149",
"0.53080386",
"0.5296864",
"0.5296097",
"0.5262749",
"0.5239213",
"0.52332866"
] | 0.64564604 | 1 |
The method is returning data for update progress bar for ajax queries | public function actionUpdateProgressBar() {
if(!Yii::app()->request->getPost('updateableIds') || !Yii::app()->request->isAjaxRequest)
return false;
$gridType = Yii::app()->request->getPost('gridType');
$projectJobIds = Yii::app()->request->getPost('updateableIds');
$response = array();
foreach($projectJobIds as $key => $projectJobId) {
$projectJob = ProjectJob::model()->findByPk($projectJobId);
ob_start();
if($gridType == 'languages')
$this->languageProgressBar($projectJob, $key);
elseif($gridType == 'jobs')
$this->jobProgressBar($projectJob, $key);
$response['data'][] = ob_get_clean();
}
echo CJSON::encode($response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function progress_bar(){\n\t\t$data['progress'] = $this->Dashboard_model->progress_bar();\n\t\t$this->load->template('progress_bar',$data);\n\t}",
"private function PROGRESS() {\n if( $this->error ) return;\n \n // Check that a process ID was given.\n if( !isset($this->params[1]) ) {\n \n $this->__status( 400 );\n \n return;\n \n }\n \n // Set the status.\n $this->__status( 200 );\n \n // Attempt to get the progress for the given ID.\n $this->data = $this->progress->getProgress($this->params[1]);\n \n }",
"abstract public function progress();",
"public function update_loop_vars() {\n\t\t$percentage = $this->queue->progress_percentage();\n\n\t\t$progress = $this->sanitize_progress( $percentage );\n\t\t$data = array(\n\t\t\t'record_id' => $this->record_id,\n\t\t\t'check' => $this->get_ajax_nonce(),\n\t\t\t'completeMsg' => __( 'Completed!', 'the-events-calendar' ),\n\t\t\t'progress' => $progress,\n\t\t\t'progressText' => sprintf( __( '%d%% complete', 'the-events-calendar' ), $progress ),\n\t\t);\n\n\t\twp_localize_script( 'tribe-ea-fields', 'tribe_aggregator_save', $data );\n\n\t\treturn $data;\n\t}",
"private function _sync_progress(){\n\t\t\tsleep(10);\n\t\t\t\n\t\t\t$settings = array(\n\t\t\t\t'cache_key' => \"synchronization\",\n\t\t\t\t'permanent' => true,\n\t\t\t);\n\t\t\t$value = get_cache_for_special_values( $settings );\n\t\t\tif( $value == 2 ){\n\t\t\t\t//sync complete\n\t\t\t\t$err = new cError(010011);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t$err->class_that_triggered_error = 'cAudit.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_sync_progress';\n\t\t\t\t$err->additional_details_of_error = '<h4>Request Complete</h4>';\n\t\t\t\t$return = $err->error();\n\t\t\t\tunset( $return[\"html\"] );\n\t\t\t\t\n\t\t\t\t$return['html_prepend'] = \"<li><strong>Request Complete!!!</strong></li>\";\n\t\t\t\t\n\t\t\t\t$settings = array(\n\t\t\t\t\t'cache_key' => \"synchronization-message\",\n\t\t\t\t\t'permanent' => true,\n\t\t\t\t);\n\t\t\t\t$msg = get_cache_for_special_values( $settings );\n\t\t\t\tif( isset( $msg[\"title\"] ) && isset( $msg[\"msg\"] ) ){\n\t\t\t\t\t$return['html_prepend'] .= \"<li><strong>\".$msg[\"title\"].\"</strong><br />\".$msg[\"msg\"].\"</li>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return['status'] = \"new-status\";\n\t\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\t$return['complete'] = 1;\n\t\t\t\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t\n\t\t\t$return['html_prepend'] = \"<li>Please wait. Processing Request...</li>\";\n\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\n\t\t\t$return['status'] = \"new-status\";\n\t\t\t$return['re_process'] = 1;\n\t\t\t$return['re_process_code'] = 1;\n\t\t\t$return['mod'] = 'import-';\n\t\t\t\n\t\t\t$return['id'] = ( isset( $this->class_settings[ 'sync_id' ] )?$this->class_settings[ 'sync_id' ]:1 );\n\t\t\t$return['action'] = ( isset( $this->class_settings[ 'sync_action' ] )?$this->class_settings[ 'sync_action' ]:'?action=audit&todo=sync_progress' );\n\t\t\t\n\t\t\treturn $return;\n\t\t}",
"protected function _calculatePercentForProgressBar()\n {\n $this->_currentPercentDoneWork = min(100, ceil(($this->_currentIteration / $this->_countIteration) * 100));\n }",
"public function getProgress()\n {\n return new Progress(array('scans_id'=> $this->id));\n }",
"function uploadprogress_get_info () {}",
"public function jobProgressBar($data, $row) {\n $progressCalculator = new ProgressCalculator();\n $percentage = $progressCalculator->getTotalProgressForJob($data);\n\n $this->renderPartial('_progressBar', array(\n 'percentage' => $percentage,\n 'row' => $row,\n 'progressPrefix' => 'jobs',\n ));\n }",
"public function getProgress() {\n return $this->progress;\n }",
"function updateProgress($div_id, $upload_id, $waitAfterupload=false){\n\t\n\t$objResponse = new XajaxResponse();\t\n\t$ul_info = uploadprogress_get_info($upload_id);\n\t$percent = intval($ul_info['bytes_uploaded']*100/$ul_info['bytes_total']);\n\tif($waitAfterupload && $ul_info['est_sec']<2) {\n\t\t$percent = 100;\n\t\t$objResponse -> addAssign($div_id.'_label' , 'innerHTML', get_lang('UploadFile').' : '.$percent.' %');\n\t\t$objResponse -> addAssign($div_id.'_waiter_frame','innerHTML','<img src=\"'.api_get_path(WEB_CODE_PATH).'img/progress_bar.gif\" />');\n\t\t$objResponse -> addScript('clearInterval(\"myUpload.__progress_bar_interval\")');\t\t\n\t}\n\t$objResponse -> addAssign($div_id.'_label' , 'innerHTML', get_lang('UploadFile').' : '.$percent.' %');\n\t$objResponse -> addAssign($div_id.'_filled' , 'style.width', $percent.'%');\n\t\n\t\n\t\n\treturn $objResponse;\n\t\n}",
"public function getProgressData(){\n $data = array();\n $data[\"serie\"] = array();\n array_push($data[\"serie\"], array('name' => \"Walking\", \"data\" => array(72.4,78.1,74.8,73.0,71.4,71.1,70.2,82.3,84.4,79.8,82.1,81.6,73.1,81.2,78.8,84.2,71.8,76.4,70.1,80.2,77.8,84.6,80.2,82.4,84.1,81.1,76.2,71.7,78.4,77.5)));\n\n\n $data[\"date\"] = array('year' => date('Y', strtotime(\"-30 day\")), \"month\" => date('m',strtotime(\"-30 day\")), \"day\" => date('d',strtotime(\"-30 day\")));\n\n echo json_encode($data);\n }",
"public function progressIndex() {\n $homestay = Homestay::where('status', 'pending')->get();\n $souvenir = Souvenir::where('status', 'pending')->get();\n $guide = Guide::where('status', 'pending')->get();\n $art = Art::where('status', 'pending')->get();\n $rm = RM::where('status', 'pending')->get();\n $tani = Tani::where('status', 'pending')->get();\n $umkm = UMKM::where('status', 'pending')->get();\n $kendaraan = Kendaraan::where('status', 'pending')->get();\n \treturn view('admin.progress')\n ->with('homestay', $homestay)\n ->with('souvenir', $souvenir)\n ->with('guide', $guide)\n ->with('art', $art)\n ->with('rm', $rm)\n ->with('tani', $tani)\n ->with('umkm', $umkm)\n ->with('kendaraan', $kendaraan);\n }",
"function showProgress() {\r\n return $this->my_money_format ($this->thermxFormat,$this->thermxProgress);\r\n\r\n}",
"public function importProgressAction() {\n return array (\n 'progress' => $this->getImporter()->getProgress(),\n );\n }",
"function create_progress() {\n\t\t// the look of this bar:\n\t\techo \"\n\t\t<style>\n\t\t#text {\n\t\tposition: absolute;\n\t\ttop: 100px;\n\t\tleft: 50%;\n\t\tmargin: 0px 0px 0px -150px;\n\t\tfont-size: 18px;\n\t\ttext-align: center;\n\t\twidth: 300px;\n\t\tcolor:#ffffff;\n\t\t\n\t}\n\t#barbox_a {\n\tposition: absolute;\n\ttop: 130px;\n\tleft: 50%;\n\tmargin: 0px 0px 0px -160px;\n\twidth: 304px;\n\theight: 24px;\n\tbackground-color: black;\n\t}\n\t.per {\n\tposition: absolute;\n\ttop: 130px;\n\tfont-size: 18px;\n\tleft: 50%;\n\tmargin: 1px 0px 0px 150px;\n\tbackground-color: #5C91C3;\n\tcolor:#ffffff;\n\t}\n\t\n\t.bar {\n\tposition: absolute;\n\ttop: 132px;\n\tleft: 50%;\n\tmargin: 0px 0px 0px -158px;\n\twidth: 0px;\n\theight: 20px;\n\tbackground-color: #0099FF;\n\t}\n\t\n\t.blank {\n\tbackground-color: white;\n\twidth: 300px;\n\t}\n\t</style>\n\t\";\n\t\n\t\t// Now output the basic, initial, XHTML that\n\t\t// will be overwritten later:\n\t\techo \"\n\t\t<div id='text'>Unosim podatke <img src='ajax-loader.gif'></div>\n\t\t<div id='barbox_a'></div>\n\t\t<div class='bar blank'></div>\n\t\t<div class='per'>0%</div>\n\t\t\";\n\t\n\t\t// Ensure that this gets to the screen\n\t\t// immediately:\n\t\t\n\t\tflush();\n\t}",
"public function getProgressReporting() {\n\t\t\tif (!isset($this->progressReporting)) {\n\t\t\t\t$result = db::execSQL(\"\n\t\t\t\t\tSELECT state.fprrefid,\n\t\t\t\t\t\t std.sfprrefid,\n\t\t\t\t\t\t state.fprdesc,\n\t\t\t\t\t\t other_desc\n\t FROM webset.statedef_freqprogrep state\n\t \t LEFT JOIN webset.std_freqprogrep std ON (std.fprrefid = state.fprrefid AND std.stdrefid = \" . $this->tsrefid . \")\n\t WHERE screfid = \" . VNDState::factory()->id . \"\n\t AND COALESCE(onlythisvnd,'\" . SystemCore::$VndName . \"') like '%\" . SystemCore::$VndName . \"%'\n\t AND (recdeactivationdt IS NULL or now()< recdeactivationdt)\n\t ORDER BY order_num\n\t\t\t\t\")->assocAll();\n\n\t\t\t\t$this->progressReporting = $result;\n\t\t\t}\n\n\t\t\treturn $this->progressReporting;\n\t\t}",
"protected function getProgressCallback()\n {\n if ($this->progress === null) {\n return function (\n $downloadTotal,\n $downloadedBytes,\n $uploadTotal,\n $uploadedBytes\n ) {\n //Do nothing\n };\n }\n return function (\n $downloadTotal,\n $downloadedBytes,\n $uploadTotal,\n $uploadedBytes\n ) {\n if ($uploadTotal === 0) {\n return;\n }\n if ($uploadedBytes === 0) {\n $this->progress->start(100);\n return;\n }\n\n if ($uploadedBytes === $uploadTotal) {\n if ($this->progress->getProgress() != 100) {\n $this->progress->setProgress(100);\n $this->progress->finish();\n $this->getIO()->write('');\n }\n return;\n }\n\n $this->progress->setProgress((int) (($uploadedBytes / $uploadTotal) * 100));\n };\n }",
"public function viewProgress()\n \t{\n \t\treturn view('progress');\n \t}",
"public function getProgressPercent()\n {\n return $this->progress_percent;\n }",
"function update_progress($percent) {\n\t\t// First let's recreate the percent with\n\t\t// the new one:\n\t\techo \"<div class='per'>{$percent}\n\t\t%</div>\\n\";\n\t\n\t\t// Now, output a new 'bar', forcing its width\n\t\t// to 3 times the percent, since we have\n\t\t// defined the percent bar to be at\n\t\t// 300 pixels wide.\n\t\techo \"<div class='bar' style='width: \",\n\t\t$percent * 3, \"px'></div>\\n\";\n\t\n\t\t// Now, again, force this to be\n\t\t// immediately displayed:\n\t\t\n\t\tflush();\n\t}",
"function national_view_progress_bar_reported($from,$to)\n\t{\n\t\t$summary_results=$this->national_view_data_summary($from,$to);\n\n\t\tforeach($summary_results as $summary_report)\n\t\t{\n\t\t\t$reported_summary=(int)$summary_report['percentage_reported'];\n\t\t}\n\n\t\t$progress_bar='<div class=\"progress-bar progress-bar-success\" role=\"progressbar\" aria-valuenow=\"'.$reported_summary.'\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:'.$reported_summary.'%;\" >\n\t\t\t\t\t\t <b>'.$reported_summary.'%</b>\n\t\t\t\t\t\t </div>';\n\n\t\treturn $progress_bar;\n\t}",
"function save_course_progress() {\n $response = $this->crud_model->save_course_progress();\n echo $response;\n }",
"function dgu_data_set_request_progress_render($subtype, $conf, $panel_args, $context) {\n $block = new stdClass();\n $query = db_select('field_data_field_review_outcome', 'o');\n $query->join('field_data_field_review_status', 's', 's.entity_id = o.entity_id');\n $query->join('node', 'n', 's.entity_id = n.nid');\n $query->fields('o', array('field_review_outcome_value'))\n ->groupBy('field_review_outcome_value')\n ->condition('n.status', NODE_PUBLISHED)\n ->condition('field_review_status_value', 6)\n ->addExpression('COUNT(o.entity_id)', 'count');\n $result = $query->execute();\n\n $outcome_field_info = field_info_field('field_review_outcome');\n $allowed_values = list_allowed_values($outcome_field_info);\n\n $id = 'data_requests_by_outcome';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_review_outcome_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by outcome',\n 'width' => '0.49',\n 'rows' => $rows,\n );\n $block->content = d3_draw($chart);\n\n\n $query = db_select('field_data_field_review_status', 's');\n $query->join('node', 'n', 's.entity_id = n.nid');\n $query->fields('s', array('field_review_status_value'))\n ->groupBy('field_review_status_value')\n ->condition('field_review_status_value', array(1, 2, 3, 4, 5), 'IN')\n ->addExpression('COUNT(s.entity_id)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_review_status');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_status';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_review_status_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by status',\n 'width' => '0.49',\n 'rows' => $rows,\n );\n $block->content .= d3_draw($chart);\n\n $query = db_select('node', 'n');\n $query->leftJoin('field_data_field_organisation_type', 't', 't.entity_id = n.nid');\n $query->fields('t', array('field_organisation_type_value'))\n ->condition('n.type', 'dataset_request')\n ->groupBy('field_organisation_type_value')\n ->addExpression('COUNT(n.nid)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_organisation_type');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_organisation_type';\n $rows = array();\n foreach($result as $row) {\n if (empty($row->field_organisation_type_value)) {\n $rows[] = array('Private individual', $row->count, $id);\n }\n else {\n $rows[] = array($allowed_values[$row->field_organisation_type_value], $row->count, $id);\n }\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by organisation type',\n 'width' => '0.99',\n 'rows' => $rows,\n );\n $hidden = d3_draw($chart);\n\n\n $query = db_select('field_data_field_barriers_reason', 'r');\n $query->join('node', 'n', 'r.entity_id = n.nid');\n $query->fields('r', array('field_barriers_reason_value'))\n ->groupBy('field_barriers_reason_value')\n ->addExpression('COUNT(r.entity_id)', 'count');\n $result = $query->execute();\n\n $status_field_info = field_info_field('field_barriers_reason');\n $allowed_values = list_allowed_values($status_field_info);\n\n $id = 'data_requests_by_reason';\n $rows = array();\n foreach($result as $row) {\n $rows[] = array($allowed_values[$row->field_barriers_reason_value], $row->count, $id);\n }\n $chart = array(\n 'id' => $id,\n 'type' => 'dgu_piechart',\n 'title' => 'Requests by reason',\n 'width' => '0.99',\n 'rows' => $rows,\n );\n $hidden .= d3_draw($chart);\n\n $block->content .= '<div class=\"vis-hidden\" style=\"display: none;\">' . $hidden . '</div><a class=\"vis-see-more pull-right\" href=\"#\">See more</a>';\n\n return $block;\n}",
"public function handle_progress(){\n\t\tcheck_admin_referer( 'xlrtr_progress_' . $this->post_type . '_' . $this->slug );\n\t\t$this->print_log();\n\t\tdie();\n\t}",
"function lbprogress($obj) {\n\tinfo('...status: %s', $obj->Status());\n}",
"function get_progress_bar($p, $width, $sectionid = 0) {\r\n\t\t$result = \r\n\t\t\t\thtml_writer::tag('div',\r\n\t\t\t\t html_writer::tag('div', \r\n\t\t\t\t\thtml_writer::tag('div', \r\n\t\t\t\t\t\t'', \r\n\t\t\t\t\t\tarray('style' => 'width: '.$p.'%; height: 15px; border: 0px; background: #9ADC00; text-align: center; float: left;', 'id' => 'oc-progress-'.$sectionid)\r\n\t\t\t\t\t), \r\n\t\t\t\t\tarray('style' => 'width: '.$width.'%; height: 15px; border: 1px; background: #aaa; solid #aaa; margin: 0; padding: 0; float: left; position: absolute;')\r\n\t\t\t\t ).\r\n\t\t\t\t html_writer::tag('div', $p.'%', array('style' => 'float: right; padding: 0; position: absolute; color: #555; width: 100%; text-align: center;', 'id' => 'oc-progress-text-'.$sectionid)).\r\n\t\t\t\t html_writer::tag('div', '', array('style' => 'clear: both;')),\r\n\t\t\t\tarray('class' => 'oc-progress-div', 'style' => 'float: left; position: relative;'));\r\n\t\treturn $result;\r\n\t}",
"public function getProgressPercentage()\n {\n return $this->progress_percentage;\n }",
"public function progressAction()\n {\n\t}",
"function pourcent_total() {\n\t$query=\"select sum(end-current)/sum(end-start+1)*100 as percent from jobs where status='rendering' or status='pause' or status='waiting';\";\n\t$results=mysql_query($query);\n\t$percent=mysql_result($results,0);\n\t$percent_done=100-$percent;\n\t\t$length_red=$percent*5;\n\t\t$length_green=(100-$percent)*5;\n\t\tif ($percent>0){\n\t\t\tprint \"<table border=0><tr>\";\n\t\t\t\t#print \"<td width=\\\"100\\\" align=\\\"right\\\" class=\\\"pourcent\\\">$pourcent</td><td width=\\\"$longueur_vert\\\" bgcolor=\\\"#006600\\\" height=\\\"30\\\"></td><td width=\\\"$longueur_rouge\\\" bgcolor=\\\"#660000\\\"></td>\";\n\t\t\t\tprint \"<img class=\\\"progress_bar big\\\" style=\\\"width:\".$length_green.\"px;\\\" src=\\\"images/cube_green.png\\\">\";\n\t\t\t\tprint \"<img class=\\\"progress_bar big\\\" style=\\\"width:\".$length_red.\"px;\\\" src=\\\"images/cube_red.png\\\">\";\n\t\t\t\tprint \": $percent_done%\";\n\t\t\tprint \"</tr></table>\";\n\t\t\t# print \"pourcent = $pourcent\";\n\t\t}\n\t\telse {\n\t\t\tprint \"<table border=0><tr>\";\n\t\t\t\tprint \"<td width=\\\"700\\\" bgcolor=\\\"#9999aa\\\" height=\\\"20\\\"><font color=\\\"#00000\\\" size=\\\"16px\\\">WAITING...</font></td>\";\n\t\t\tprint \"</tr></table>\";\n\t\t}\n\t\t\t\n\n\t$query=\"select name,(end-current)/(end-start+1)*100 as pourcent from jobs where status='rendering' or status='pause' or status='waiting';\";\n}"
] | [
"0.6710743",
"0.66291505",
"0.6542603",
"0.6455298",
"0.6324636",
"0.63112086",
"0.6201238",
"0.6190121",
"0.61623675",
"0.6159924",
"0.6096778",
"0.60930645",
"0.59248894",
"0.5913908",
"0.5904221",
"0.5852365",
"0.5801267",
"0.577102",
"0.5765407",
"0.5760805",
"0.57500786",
"0.5739902",
"0.57318884",
"0.5714953",
"0.56801975",
"0.5665383",
"0.56607604",
"0.56400067",
"0.5636172",
"0.56118315"
] | 0.7005502 | 0 |
Devuelve Verdadero si se encuentra el id_detalle_cierre | public function check_descuento_cierre($id_cierre, $id_detalle_descuento) {
$this->db->from($this->table);
$this->db->where('id_cierre', $id_cierre);
$this->db->where('id_detalle_descuento', $id_detalle_descuento);
$this->db->limit(1);
$query = $this->db->get();
if ($query->num_rows() == 0) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function obtener_detalle($id_detalle_cierre) {\n $this->db->from($this->table);\n $this->db->where('id_detalle_cierre', $id_detalle_cierre);\n $query = $this->db->get();\n return $query->result(); // Ojo que lo envio como result no row();\n }",
"public function obtener_detalle($id_detalle_cierre) {\n $this->db->from($this->table);\n $this->db->where('id_detalle_cierre', $id_detalle_cierre);\n $query = $this->db->get();\n return $query->result(); // Ojo que lo envio como result no row();\n }",
"function CambiarEstadoDetalle($iddetalle)\r\n {\r\n $con = new ConexionBD;\r\n if($con->conectar()==true) //Estado RC--> Resultados Completo\r\n {\t$query=\"UPDATE sec_detallesolicitudestudios SET estadodetalle=7 WHERE id=$iddetalle\";\t\r\n $result = pg_query($query);\r\n if (!$result)\r\n return false;\r\n else\r\n return $result;\t \r\n }\r\n }",
"function modificarNotaDetalle(){\n\t\t$this->procedimiento='fac.ft_nota_detalle_ime';\n\t\t$this->transaccion='FAC_DENO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_nota_detalle','id_nota_detalle','int4');\n\t\t$this->setParametro('id_factura_detalle','id_factura_detalle','int4');\n\t\t$this->setParametro('id_nota','id_nota','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('importe','importe','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function ver_cliente($id)\n {\n $query = $this->db->query(\"SELECT * FROM clientes WHERE id='$id' AND mostrar = 0\");\n\n $resultado = $query->row_array();\n if($resultado == NULL)\n {\n return 0;\n }\n else\n {\n return $resultado;\n }\n }",
"function getIdInventario($arregloDatos) \n\n {\n\n $sql = \" SELECT codigo \n\n FROM inventario_entradas\n\n WHERE arribo='$arregloDatos[arribo]'\";\n\n \n\n //echo $sql;\n\n $this->query($sql);\n\n if ($this->_lastError) {\n\n $this->mensaje = \"error al borrar mercancia del levante \";\n\n \n\n $this->estilo = $this->estilo_error;\n\n return TRUE;\n\n }\n\n $this->fetch();\n\n return $this->codigo;\n\n }",
"function getIdRetiro($arregloDatos) {\n\n $sql = \" SELECT max(codigo) as codigo FROM inventario_maestro_movimientos\";\n\n\n\n $this->query($sql);\n\n if ($this->_lastError) {\n\n $this->mensaje = \"error al consultar ID levante \";\n\n $this->estilo = $this->estilo_error;\n\n return TRUE;\n\n }\n\n }",
"function formulaires_signaler_abus_verifier_dist($objet,$id_objet){\n\t$erreurs=array();\n\t\n\tif(!_request('commentaire'))$erreurs['commentaire']=_T(\"info_obligatoire\");\n\t\n\treturn $erreurs;\n}",
"function retour_idpersonne_chambre_fiche($id){\nreturn ResultatRequette(\"select ID_PERSONNE as info from occuper where ID_OCCUPATION='$id'\");\n}",
"public function obtener_detalle_cierre($id_cierre, $id_producto, $id_familia) {\n $this->db->from($this->table);\n $this->db->where('id_cierre', $id_cierre);\n $this->db->where('id_producto', $id_producto);\n $this->db->where('id_familia', $id_familia);\n $query = $this->db->get();\n return $query->result(); // Ojo que lo envio como result no row();\n }",
"public function obtener_descuento_cierre($id_cierre, $id_detalle_descuento) {\n $this->db->from($this->table);\n $this->db->where('id_cierre', $id_cierre);\n $this->db->where('id_detalle_descuento', $id_detalle_descuento);\n $query = $this->db->get();\n return $query->result(); // Ojo que lo envio como result no row();\n }",
"function formulaires_editer_cirv_objet_charger($type,$id){\n\t$id = intval($id);\n\t$id_table_objet = id_table_objet($type);\n\t\n\tif (!autoriser('modifier', 'auteur', $id_auteur))\n\t\treturn false;\n\t\n\t$row = sql_fetsel(\"*\", \"spip_auteurs\", \"id_auteur=$id\",\"\",\"\");\t\n\t$statut = $row['statut'];\n\t$cistatut = $row['cistatut'];\n\tif (!$cistatut)\n\t\t$cistatut = 'non';\n\t\n\tif ($statut=='1comite') {\n\t\t$valeurs = array();\n\t\t$valeurs['editable'] = false;\n\t\t$valeurs['cistatut'] = false;\n\t\t$valeurs[$id_table_objet] = intval($id);\n\t\t$valeurs['name'] = $cistatut;\n\t\t$valeurs['_hidden'] = \"<input type='hidden' name='id_auteur' value='$id' />\";\n\t\t$valeurs['_cirvt'] = '';\n\t\tif (!defined('_CIRV_PAS_CIREDVALTOUT'))\n\t\t\t$valeurs['_cirvt'] = 'oui';\t\t\n\t} else {\n\t\t$valeurs = false;\n\t}\n\n\treturn $valeurs;\n}",
"function formulaires_editer_devoir_identifier_dist($id_devoir='new', $retour='', $lier_trad=0, $config_fonc='', $row=array(), $hidden=''){\n\treturn serialize(array(intval($id_devoir)));\n}",
"function verif_ident($nom, $mdp, &$profil) {\n //requete select en BD -> voir fin cours PDO -> requete paramétrée\n require (\"connectBD.php\"); \n $sql = \"SELECT * FROM entreprise where nomEnt=:nom and mdpEnt=:mdp\";\n try {\n $commande = $pdo->prepare($sql);\n $commande->bindParam(':nom', $nom, PDO::PARAM_STR);\n $commande->bindParam(':mdp', $mdp, PDO::PARAM_STR);\n $commande->execute();\n \n if ($commande->rowCount() > 0) { //compte le nombre d'enregistrement\n $profil = $commande->fetch(PDO::FETCH_ASSOC); //svg du profil\n return true;\n }\n else {\n return false;\n }\n }\n catch (PDOException $e) {\n echo utf8_encode(\"Echec de select : \" . $e->getMessage() . \"\\n\");\n die(); // On arrête tout\n }\n// return true ou false; suivant le cas\n}",
"function insertarNotaDetalle(){\n\t\t$this->procedimiento='fac.ft_nota_detalle_ime';\n\t\t$this->transaccion='FAC_DENO_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_factura_detalle','id_factura_detalle','int4');\n\t\t$this->setParametro('id_nota','id_nota','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('importe','importe','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function estVide() {\n\t\t\treturn $this->contenu == null;\n\t\t}",
"public function verifieFiliereSemestres() {\n try {\n global $bdd;\n $res = $bdd->prepare('select id_f from filiere where id_f=:idf');\n $res->execute(array('idf' => $this->idf));\n $don = $res->fetchAll();\n if (empty($don)) {\n throw new Exception('Filiere non trouve');\n }\n $res->closeCursor();\n $resSem = $bdd->prepare('select nom_s from semestre where nom_s=:si and nom_s_eq=:sj');\n $resSem->execute(array('si' => $this->si, 'sj' => $this->sj));\n $donSem = $resSem->fetchAll();\n $resSem->closeCursor();\n if (empty($donSem)) {\n throw new Exception('semestre non trouve,ou les deux semestres ne sont pas dans meme anne');\n }\n return TRUE;\n } catch (Exception $e) {\n echo '<script>alert(\"' . $e->getMessage() . '\");</script>';\n }\n $this->pretAdelibrer = FALSE;\n return FALSE;\n }",
"protected function Leer_Detalle()\n\t{\n\t\t//if ( ! is_null( $this->detalle ) )\n\t\t//\t{\n\t\t//\t\t$this->detalle->set_id_lado_uno($this->id) ;\n\t\t//\t\t$this->detalle->leer_lista() ;\n\t\t//\t}\n\t}",
"function obtenirReqIdFicheFrais() {\r\n\t\t\t$req = \"select visiteur.nom as nom, visiteur.id as id, visiteur.prenom as prenom from visiteur\";\r\n\t\t\t$res = PdoGsb::$monPdo->query($req);\r\n\t\t\t$visiteur = $res->fetchAll();\r\n\t\t\treturn $visiteur;\r\n\t}",
"function recup_id_responsable__personne_visite($nom,$prenom){\n return ResultatRequette(\"select ID_CLIENT as info from personne_physique where NOM_CLIENT='$nom' AND PRENOM_CLIENT='$prenom'\");\n}",
"function clients_verifier_infos_legales($id_auteur){\n\t$row = sql_fetsel('*','spip_auteurs','id_auteur='.intval($id_auteur));\n\tif (!$row) return false;\n\tif (!$row['name']) return false;\n\tif (!$row['email']) return false;\n\tif (!$row['adresse_1']) return false;\n\tif (!$row['adresse_cp']) return false;\n\tif (!$row['adresse_ville']) return false;\n\tif (!$row['adresse_pays']) return false;\n\treturn true;\n}",
"function existeFicheFrais( $unMois, $unIdVisiteur) {\n $unMois = filtrerChainePourBD($unMois);\n $requete = \"select idVisiteur from FicheFrais where idVisiteur='\" . $unIdVisiteur . \n \"' and mois='\" . $unMois . \"'\";\n $idJeuRes = PdoGsb::$monPdo->query($requete); \n if($idJeuRes->rowCount() == 1)\n return true;\n else\n return false;\n}",
"function formulaires_editer_produit_verifier($id_produit='new', $id_rubrique=0, $retour=''){\r\n\tset_request('id_parent', _request('parent'));\r\n\r\n\t$erreurs = array();\r\n\t$erreurs = formulaires_editer_objet_verifier('produit', $id_produit);\r\n\t\r\n\t$config = lire_config('produits') ;\r\n\t// Vérifier que la rubrique choisie se trouve dans les secteurs autorisés\r\n\tif($config['limiter_ajout']) {\r\n\t\t$id_secteur = sql_getfetsel(\"id_secteur\", \"spip_rubriques\", \"id_rubrique=\" . intval(produits_id_parent()));\r\n\t\tif(is_array($config['limiter_ident_secteur']) && !in_array($id_secteur,$config['limiter_ident_secteur'])) {\r\n\t\t\t$titres = \"\" ;\r\n\t\t\tforeach($config['limiter_ident_secteur'] as $id_secteur) {\r\n\t\t\t\t$titres .= sql_getfetsel(\"titre\", \"spip_rubriques\", \"id_rubrique=\" . intval($id_secteur)).\" / \" ;\r\n\t\t\t}\r\n\t\t\t$erreurs['id_parent'] .= _T(\"produits:secteurs_autorises\", array('secteurs' => $titres));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $erreurs ;\r\n}",
"public function ActDetalle($idcompra)\r\n\t{\r\n\t\t$sql=\"UPDATE tbcomprad\r\n SET \r\n anulado='1',\r\n importado='0'\r\n WHERE idcompra='$idcompra'\";\r\n\t\treturn ejecutarConsulta($sql);\t\t\r\n }",
"public function getDependenciaId()\n {\n return $this->dependencia_id;\n }",
"public function visiteurFicheEnCours() {\n $req = \" Select distinct(id),nom,prenom from visiteur inner join fichefrais on fichefrais.idVisiteur = visiteur.id Where fichefrais.idEtat='CR'\";\n return PdoGsb::$monPdo->query($req);\n }",
"function obtenirDetailFicheFrais($unMois, $unIdVisiteur) {\n $unMois = filtrerChainePourBD($unMois);\n $ligne = false;\n $requete=\"select IFNULL(nbJustificatifs,0) as nbJustificatifs, Etat.id as idEtat, libelle as libelleEtat, dateModif, montantValide \n from FicheFrais inner join Etat on idEtat = Etat.id \n where idVisiteur='\" . $unIdVisiteur . \"' and mois='\" . $unMois . \"'\";\n $idJeuRes = PdoGsb::$monPdo->query($requete); \n if ( $idJeuRes ) {\n $ligne = $idJeuRes->fetch();\n } \n\n return $ligne ;\n}",
"public function SaberPadre($id_padre){\n //para saber si es padre basta con una consulta que seleccione desde la tabla herencia la equivalencia del codigo padre que recibe la funcion.\n //query sin sprintf\n $query = \"SELECT * FROM herencia WHERE padre = \".$id_padre;\n $result = $this->db->getData($query);\n //var_dump($query);\n // en caso de que la consulta arroje un valor mayor a 0 devolverá un true para dar como respuesta que es padre\n if (count($result)>0) {\n return true;\n }else{\n return false;\n }\n }",
"function eliminarNotaDetalle(){\n\t\t$this->procedimiento='fac.ft_nota_detalle_ime';\n\t\t$this->transaccion='FAC_DENO_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_nota_detalle','id_nota_detalle','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function check_producto_cierre($id_cierre, $id_producto, $id_familia) {\n $this->db->from($this->table);\n $this->db->where('id_cierre', $id_cierre);\n $this->db->where('id_producto', $id_producto);\n $this->db->where('id_familia', $id_familia);\n $this->db->limit(1);\n $query = $this->db->get();\n if ($query->num_rows() == 0) {\n return true;\n } else {\n return false;\n }\n }"
] | [
"0.6881641",
"0.6881641",
"0.6512572",
"0.64628804",
"0.64569473",
"0.64337134",
"0.638852",
"0.63579196",
"0.6333485",
"0.63303554",
"0.6328223",
"0.6295037",
"0.62627125",
"0.6246545",
"0.6234125",
"0.62183577",
"0.62121755",
"0.6207004",
"0.61912364",
"0.6187871",
"0.6151452",
"0.6136694",
"0.60899854",
"0.60863346",
"0.6069671",
"0.60639685",
"0.6062975",
"0.60498637",
"0.603701",
"0.60312414"
] | 0.7084957 | 0 |
Si el cierre y el id_detalle_descuento se encuentra en el descuento uso el de abajo | public function obtener_descuento_cierre($id_cierre, $id_detalle_descuento) {
$this->db->from($this->table);
$this->db->where('id_cierre', $id_cierre);
$this->db->where('id_detalle_descuento', $id_detalle_descuento);
$query = $this->db->get();
return $query->result(); // Ojo que lo envio como result no row();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function check_descuento_cierre($id_cierre, $id_detalle_descuento) {\n $this->db->from($this->table);\n $this->db->where('id_cierre', $id_cierre);\n $this->db->where('id_detalle_descuento', $id_detalle_descuento);\n $this->db->limit(1);\n $query = $this->db->get();\n if ($query->num_rows() == 0) {\n return true;\n } else {\n return false;\n }\n }",
"function descontarLote($detalle){\n\n\t\tforeach ($detalle as $value) {\n\n\t\t\t$a = json_decode($value);\n\t\t\t$tmp['cantidad'] = $a->cantidad;\n\t\t\t$tmp['lote_id'] = $a->lote_id_origen;\n\t\t\t$item[] = $tmp;\n\t\t\t$resp_det = $this->Movimdeposalida->descontarEnLote($item);\n\t\t\tif (!$resp_det) {\n\t\t\t\treturn $resp_det;\n\t\t\t\tlog_message('ERROR','#TRAZA|TRAZ-COMP-ALMACENES|MOVIMIENTODEPOSALIDA|descontarLote($detalle) >> ERROR: No desconto en lote la cantidad enviada ');\n\t\t\t}\n\t\t\tunset($item);\n\t\t}\n\n\t\treturn $resp_det;\n\t}",
"public function verificarDescuentosTemporales(){\n $run = new Method;\n $query = \" UPDATE servicios set Descuento = 0, descuentoTemporal = 0\n WHERE\n descuentoTemporal = 1\n AND\n EstatusInstalacion = 1\n \";\n // servicios descuentoTemporal = 1 y EstatusInstalacion = 1 significa que ya se genero su primer doc de cobro \n $servicios = $run->update($query);\n }",
"function detalle_orden($nro_orden,$imprimir_todo=1,$ocultar_cliente=1)\r\n{ global $db;\r\n\t//obtengo los datos de la orden de compra\r\n\t$sql=\"select orden_de_compra.cliente,orden_de_compra.fecha_entrega,orden_de_compra.lugar_entrega,\";\r\n\t$sql.=\" orden_de_compra.cliente,orden_de_compra.internacional,honorarios_gastos,monto_flete,\";\r\n\t$sql.=\" proveedor.razon_social, plantilla_pagos.descripcion, \";\r\n\t$sql.=\" moneda.nombre,moneda.simbolo \";\r\n\t$sql.=\" from orden_de_compra\";\r\n\t$sql.=\" join moneda using(id_moneda) \";\r\n\t$sql.=\" join proveedor using(id_proveedor) \";\r\n\t$sql.=\" join plantilla_pagos using(id_plantilla_pagos)\r\n\t left join datos_oc_internacional using (nro_orden)\";\r\n\t$sql.=\" where orden_de_compra.nro_orden=$nro_orden \";\r\n\t$resultado=sql($sql,\"<br>Error al traer los datos de la OC para el detalle\") or fin_pagina();\r\n\r\n\tif($ocultar_cliente)\r\n\t $cliente=CORADIR;\r\n\telse\r\n\t $cliente=$resultado->fields[\"cliente\"];\r\n\t$fecha_entrega=fecha($resultado->fields[\"fecha_entrega\"]);\r\n\t$lugar_entrega=$resultado->fields[\"lugar_entrega\"];\r\n\t$proveedor=$resultado->fields[\"razon_social\"];\r\n\t$forma_pago=$resultado->fields[\"descripcion\"];\r\n\t$moneda=$resultado->fields[\"nombre\"];\r\n\t$moneda_simbolo=$resultado->fields[\"simbolo\"];\r\n\t$internacional=$resultado->fields[\"internacional\"];\r\n\t$total_flete=$resultado->fields[\"monto_flete\"];\r\n\t$total_honorarios=$resultado->fields[\"honorarios_gastos\"];\r\n\r\n\t//obtengo la descripcipon de las filas de la orden de compra\r\n\t$sql=\"select descripcion_prod,desc_adic,cantidad,precio_unitario\";\r\n\tif($internacional)\r\n\t $sql.=\",proporcional_flete,base_imponible_cif,derechos,iva,ib\";\r\n\t$sql.=\" from fila\";\r\n\t$sql.=\" where nro_orden=$nro_orden\";\r\n\t$filas_orden_compra=sql($sql,\"<br>Error en Consulta de Cantidades de Orden de Compra<br>\") or fin_pagina();\r\n\t$cantidad_filas=$filas_orden_compra->RecordCount();\r\n\r\n\tif(!$internacional)\r\n\t $mensaje=\"Orden de Compra Nº $nro_orden\";\r\n\telse\r\n\t $mensaje=\"Orden de Compra Internacional Nº $nro_orden\";\r\n\r\n\t$mensaje.=\"\\nDescripción\";\r\n\tif ($imprimir_todo==1)\r\n\t{\r\n\t$mensaje.=\"\\nCliente: $cliente\";\r\n\t$mensaje.=\"\\nFecha Entrega: $fecha_entrega \";\r\n\t$mensaje.=\"\\nLugar Entrega: $lugar_entrega\";\r\n\t$mensaje.=\"\\nProveedor: $proveedor\";\r\n\t$mensaje.=\"\\nForma de Pago: $forma_pago\";\r\n\t$mensaje.=\"\\nMoneda: $moneda\";\r\n\t}\r\n\t$mensaje.=\"\\n\";\r\n\t$mensaje.=\"\\nProductos:\";\r\n\tif(!$internacional)\r\n\t{\r\n\t $mensaje.=\"\\n---------------------------------------------------\";\r\n\t $mensaje.=\"\\nCantidad Descripción P. Unitario P.Total\";\r\n\t $mensaje.=\"\\n---------------------------------------------------\";\r\n\t}\r\n\telse\r\n\t{\r\n\t $mensaje.=\"\\n----------------------------------------------------------------------------------------------------\";\r\n\t $mensaje.=\"\\nCantidad - Descripción - P. Unitario - P.Total - Prop. Flete - Base Imp. CIF - Derechos - IVA - IB\";\r\n\t $mensaje.=\"\\n----------------------------------------------------------------------------------------------------\";\r\n\t}\r\n\t$total_general=0;\r\n\t$total_iva_ganancias=0;\r\n\t$total_ib=0;\r\n\t$total_derechos=0;\r\n\tfor($i=0;$i<$cantidad_filas;$i++)\r\n\t{\r\n\t $cantidad=$filas_orden_compra->fields[\"cantidad\"];\r\n\t $descripcion=$filas_orden_compra->fields[\"descripcion_prod\"].\" \".$filas_orden_compra->fields[\"desc_adic\"];\r\n\t $precio_unitario=$filas_orden_compra->fields[\"precio_unitario\"];\r\n\t $precio=number_format($precio_unitario,\"2\",\".\",\"\");\r\n\t\t$precio_total=number_format(($cantidad*$precio_unitario),\"2\",\".\",\"\");\r\n\t\tif($internacional)\r\n\t\t{\r\n\t\t $prop_flete=number_format($filas_orden_compra->fields[\"proporcional_flete\"],2,'.','');\r\n\t\t $base_imp_cif=number_format($filas_orden_compra->fields[\"base_imponible_cif\"],2,'.','');\r\n\t\t $derechos=number_format($filas_orden_compra->fields[\"derechos\"],2,'.','');\r\n\t\t $iva=number_format($filas_orden_compra->fields[\"iva\"],2,'.','');\r\n\t\t $ib=number_format($filas_orden_compra->fields[\"ib\"],2,'.','');\r\n\r\n\t\t $total_iva_ganancias+=$filas_orden_compra->fields[\"iva\"];\r\n\t\t $total_ib+=$filas_orden_compra->fields[\"ib\"];\r\n\t\t $total_derechos+=$filas_orden_compra->fields[\"derechos\"];\r\n\t\t}\r\n\r\n\t\t$total_general+=$precio_total;\r\n\t $mensaje.=\"\\n$cantidad - $descripcion - $moneda_simbolo $precio - $moneda_simbolo $precio_total\";\r\n\t if($internacional)\r\n\t $mensaje.=\" - $moneda_simbolo $prop_flete - $moneda_simbolo $base_imp_cif - $moneda_simbolo $derechos - $moneda_simbolo $iva - $moneda_simbolo $ib\";\r\n\t $filas_orden_compra->MoveNext();\r\n\r\n\t}//de for($i=0;$i<$cantidad_filas;$i++)\r\n\t$mensaje.=\"\\n---------------------------------------------------\";\r\n\tif(!$internacional)\r\n\t $mensaje.=\"\\nPrecio Total de la Orden: $moneda_simbolo \".number_format($total_general,\"2\",\".\",\"\");\r\n\telse //si la OC es internacional, agregamos los datos correspondientes\r\n\t{$mensaje.=\"\\nTotal FOB: $moneda_simbolo \".number_format($total_general,\"2\",\".\",\"\");\r\n\t $mensaje.=\"\\nFlete: $moneda_simbolo \".number_format($total_flete,2,'.','');\r\n\t $mensaje.=\"\\nTotal I.V.A./Ganancias: $moneda_simbolo \".number_format($total_iva_ganancias,2,'.','');\r\n\t $mensaje.=\"\\nTotal I.B.: $moneda_simbolo \".number_format($total_ib,2,'.','');\r\n\t $mensaje.=\"\\nTotal Derechos: $moneda_simbolo \".number_format($total_derechos,2,'.','');\r\n\t $mensaje.=\"\\nHonorarios y Gastos: $moneda_simbolo \".number_format($total_honorarios,2,'.','');\r\n\t $total_global=$total_general+$total_flete+$total_iva_ganancias+$total_ib+$total_derechos+$total_honorarios;\r\n\t $mensaje.=\"\\nTOTAL GLOBAL: $moneda_simbolo \".number_format($total_global,2,'.','');\r\n\t}\r\n\r\n\treturn $mensaje;\r\n}",
"function get_descripcion()\n\t{\n\t\t//1 empleado tiene N tareas, 1 Tarea puede estar en N empleados\n\t\t//1 tarea puede estar en N departamentos, 1 departamento tiene N tareas\n\t\treturn \"OBJETO datos_relacion (N-N Deptos.)\";\n\t}",
"public static function setTblcupondescuento($codigo, $descuento , $puntoscliente, $activado, $idtblcliente,$emailcreo){\n \n $insert =\"INSERT INTO tblcupondescuento (tblcupondescuento_codigo, tblcupondescuento_descuento, tblcupondescuento_puntoscliente, tblcupondescuento_activado, tblcliente_idtblcliente, tblcupondescuento_fchmodificacion, tblcupondescuento_fchcreacion, tblcupondescuento_emailusuacreo, tblcupondescuento_emailusuamodifico) VALUES (?,?,?,?,?,NOW(),NOW(),?,?)\"; \n \n try{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($insert);\n\t\t\t$resultado->bindParam(1,$codigo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$descuento,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(3,$puntoscliente,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(5,$idtblcliente,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(6,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(7,$emailcreo,PDO::PARAM_STR);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el insert\n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n }",
"function DetalleEstadoApertura(){\r\n $this->procedimiento='vef.ft_apertura_cierre_caja_sel';\r\n $this->transaccion='VF_DETA_SEL';\r\n $this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n $this->captura('id_apertura_cierre_caja','int4');\r\n $this->captura('fecha_apertura_cierre','date');\r\n $this->captura('estado','varchar');\r\n $this->captura('nombre','varchar');\r\n $this->captura('codigo','varchar');\r\n $this->captura('desc_persona','text');\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"public function obtenerSolicitanteDescargable(){\n $moduloBuscado = $this->elementoFiltro->getType();\n\n $sql = \"\n SELECT uid_documento_atributo, uid_$moduloBuscado, uid_modulo_origen, uid_elemento_origen, alias\n FROM \". DB_DOCS .\".documento_atributo da\n LEFT JOIN \". DB_DOCS .\".anexo_$moduloBuscado am\n USING( uid_documento_atributo )\n WHERE da.descargar\n AND da.uid_documento = $this->uid\n AND da.uid_modulo_destino = \".$this->elementoFiltro->getModuleId().\" LIMIT 1\";\n $datos = $this->db->query( $sql, true );\n if( !count($datos) ){ return false; }\n $datos = reset($datos);\n\n $modulo = $this->getModuleName($datos[\"uid_modulo_origen\"]);\n\n $solicitante = new $modulo($datos[\"uid_elemento_origen\"]);\n\n return $solicitante;\n }",
"function get_descuento( $iddescuento ) {\n\n // retrive the data\n $dbConn = $GLOBALS['dbConn'];\n\n // retrieved value in the database\n $_resultSet = $dbConn->doQuery(\"SELECT * FROM systarjetas.descuento WHERE iddescuento = '$iddescuento'\");\n\n $__descuentoObj = new descuento();\n // return the retrived from the database\n\n // create a new object\n $__obj = new Descuento();\n if(isset($_resultSet[0]['iddescuento'])){;\n $__obj->set_iddescuento($_resultSet[0]['iddescuento']);\n $__obj->set_idtarjeta($_resultSet[0]['idtarjeta']);\n $__obj->set_descripcion($_resultSet[0]['descripcion']);\n $__obj->set_arancel($_resultSet[0]['arancel']);\n $__obj->set_habilitado($_resultSet[0]['habilitado']);\n $__obj->set__usuario($_resultSet[0]['_usuario']);\n $__obj->set__fechamodifica($_resultSet[0]['_fechamodifica']);\n }\n\n\n return $__obj;\n }",
"public static function setUpdateTblcupondescuentoSinEst($idcupon,$nombre,$valor,$idciudad,$emailmodifico,$fecha){\n\n\t\t$update = \"UPDATE tblcupondescuento SET tblcupondescuento_codigo = ?,\n\t\t tblcupondescuento_descuento = ?, tblciudad_idtblciudad = ?, \n\t\t tblcupondescuento_fchmodificacion = NOW(), tblcupondescuento_emailusuamodifico= ?,tblcupondescuento_fchexpira=? \n\t\t WHERE idtblcupondescuento = ?\";\n \n\t\ttry{\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($update);\n\t\t\t$resultado->bindParam(1,$nombre,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$valor,PDO::PARAM_INT);\t\t\t\n\t\t\t$resultado->bindParam(3,$idciudad,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(4,$emailmodifico,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(5,$fecha,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(6,$idcupon,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->rowCount(); //retorna el numero de registros afectado por el update\n\t\t}catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"public function descripcion_evento($id){\r\n \r\n $data['session'] = $this->general_sessions->datosDeSession(); \r\n \r\n //Obtenemos el id del evento\r\n $id_cita_medica = evaluar($id);\r\n \r\n //Obtener datos de la cita medica\r\n $row = $this->agenda_model->info_cita_medica($id_cita_medica,$data['session'][\"id_empresa\"]);\r\n \r\n $data[\"estadosCitas\"] = $this->dropdown_model->cargarEstadosCitasMed($row[\"id_estado_cita_medica\"]);\r\n \r\n //Creamos variables para nuestra vista\r\n $data[\"id_cita_medica\"] = $id_cita_medica;\r\n $data[\"id_historia_med\"] = $row['id_historia_medica'];\r\n $data[\"id_paciente\"] = $row['id_paciente'];\r\n $data[\"paciente\"] = $row['nom_paciente'];\r\n $data[\"rut\"] = $row['rut'];\r\n $data[\"correo\"] = $row['email'] != \"\" ? $row['email'] : \"no informado\";\r\n $data[\"celular\"] = $row['celular'] != \"\" ? $row['celular'] : \"no informado\";\r\n $data[\"tel_fijo\"] = $row['telefono'] != \"\" ? $row['telefono']: \"no informado\";\r\n $data[\"nota\"] = $row['body'] != \"\" ? $row['body'] : \"Sin comentarios\";\r\n $data[\"inicio\"] = $row['inicio_normal'];\r\n $data[\"final\"] = $row['final_normal'];\r\n $data[\"imagen\"] = $row['imagen'] != \"\" ? $row['imagen']: \"sin-foto.png\";\r\n \r\n $this->load->view('admin/descripcion_cita_view',$data);\r\n }",
"function generarDescuentoCheque(){\n\t\t$this->procedimiento='plani.ft_planilla_ime';\n\t\t$this->transaccion='PLA_GENDESCHE_PRO';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_planilla','id_planilla','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function getIddesconto()\n {\n return $this->iddesconto;\n }",
"function modificarNotaDetalle(){\n\t\t$this->procedimiento='fac.ft_nota_detalle_ime';\n\t\t$this->transaccion='FAC_DENO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_nota_detalle','id_nota_detalle','int4');\n\t\t$this->setParametro('id_factura_detalle','id_factura_detalle','int4');\n\t\t$this->setParametro('id_nota','id_nota','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('importe','importe','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public static function getAllTblcuponesdescuentoPorExpirarByidcliente($idtblcliente){\n\n\t\t$activado=1;\n\t\t$consulta = \"SELECT TCD.* FROM tblcupondescuento TCD \n\t\t\t\t\tINNER JOIN tblciudad TC ON TC.idtblciudad = TCD.tblciudad_idtblciudad\n\t\t\t\t\tINNER JOIN tblcliente TCL ON TCL.tblcliente_ciudad = TC.tblciudad_nombre\n\t\t\t\t\tWHERE NOT EXISTS \n\t\t\t\t\t\t(SELECT 1 FROM tblhistcupondescuento THCD \n\t\t\t\t\t \tWHERE TCD.tblcupondescuento_codigo = THCD.tblhistcupondescuento_cupon \n\t\t\t\t\t \t\tAND THCD.tblhistcupondescuento_idtblcliente = ?) \n\t\t\t\t\tAND TCD.tblcupondescuento_activado = ? \n\t\t\t\t\tAND (DATEDIFF(TCD.tblcupondescuento_fchexpira,NOW()))<6 \n\t\t\t\t\tAND TCD.tblcupondescuento_fchexpira>NOW()\n\t\t\t\t\tAND TCL.idtblcliente=?\n\t\t\t\t\tGROUP BY TCD.idtblcupondescuento \";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n\t\t\t$resultado->bindParam(1,$idtblcliente,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n\t\t\t$resultado->bindParam(3,$idtblcliente,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro \n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"protected function Leer_Detalle()\n\t{\n\t\t//if ( ! is_null( $this->detalle ) )\n\t\t//\t{\n\t\t//\t\t$this->detalle->set_id_lado_uno($this->id) ;\n\t\t//\t\t$this->detalle->leer_lista() ;\n\t\t//\t}\n\t}",
"function _dbfetch_saleorder_details($id) {\n\t\tif (!is_numeric($id) OR $id == 0) return FALSE;\n\t\tif (!is_array($this->_aIDAlbaran)) $hay_albaranes = 0;\n\t\telse $hay_albaranes = sizeof($this->_aIDAlbaran);\n\t\t$leyenda_divisa = $this->_aDivisa['leyenda'];\n\t\t$campo_accion = $this->_aTarifa['campo_accion'];\n\t\t$campo_rec = $this->_aTarifa['campo_recomendacion'];\n\t\t$oDb = $this->_db;\n\n\t\t$cons = \"SELECT Det.id_detalle as 'id_detalle', \".\n\t\t\t\t\t\"Det.id_articulo as 'id_articulo', \".\n\t\t\t\t\t\"Det.id_pedido as 'id_pedido', \".\n\t\t\t\t\t\"Det.id_servicio as 'id_servicio', \".\n\t\t\t\t\t\"Det.cantidad_recibida as 'cantidad_recibida', \".\n\t\t\t\t\t( ($hay_albaranes) \n\t\t\t\t\t\t? \"Det.cantidad - Det.cantidad_recibida as 'cantidad_residual', \"\n\t\t\t\t\t\t: \"\" ).\n\t\t\t\t\t\"ROUND(Det.cantidad,\".$this->tot_decimals.\") as 'cantidad', \".\n\t\t\t\t\t\"ROUND(Det.precio_articulo,\".$this->tot_decimals.\") as 'precio_tarifa', \".\n\t\t\t\t\t\"Det.descuento as 'descuento', \".\n\t\t\t\t\t\"ROUND(Det.monto,\".$this->tot_decimals.\") as 'monto', \".\n\t\t\t\t\t\"ROUND(Det.monto_total,\".$this->tot_decimals.\") as 'base_imponible', \".\n\t\t\t\t\t// \"Det.precio_articulo - (Det.precio_articulo * Det.descuento / 100) \".\n\t\t\t\t\t // \"- Det.monto as 'precio_tarifa_descuento', \".\n\t\t\t\t\t\"IF ( (Det.descuento > 0 OR Det.monto > 0),\".\n\t\t\t\t\t\"IF(Det.descuento>0,CONCAT(Det.descuento,' %'),CONCAT(Det.monto,' $leyenda_divisa')) \".\n\t\t\t\t\t\",NULL) as 'tipo_descuento', \".\n\t\t\t\t\t\"IF ( (Det.descuento > 0 OR Det.monto > 0),\".\n\t\t\t\t\t\t\"IF(Det.descuento>0,\".\n\t\t\t\t\t\t\t\"Det.precio_articulo - (Det.precio_articulo * Det.descuento / 100),\".\n\t\t\t\t\t\t\t\t\"Det.precio_articulo - Det.monto) \".\n\t\t\t\t\t\t\",NULL) as 'precio_tarifa_descuento', \".\n\t\t\t\t\t\"Det.observaciones as 'observaciones', \".\n\t\t\t\t\t\"Art.nombre as 'nombre', \".\n\t\t\t\t\t\"Art.referencia as 'referencia', \".\n\t\t\t\t\t\"Art.descripcion as 'descripcion', \".\n\t\t\t\t\t\"Art.id_familia as 'id_familia', \".\n\t\t\t\t\t\"Fam.nombre as 'nombre_familia', \".\n\t\t\t\t\t\"Art.id_marca as 'id_marca', \".\n\t\t\t\t\t\"Mca.nombre as 'nombre_marca', \".\n\t\t\t\t\t\"Art.peso_unidad as 'peso_unidad', \".\n\t\t\t\t\t\"Art.id_unidad_medida as 'id_unidad_medida', \".\n\t\t\t\t\t\"Um.leyenda as 'leyenda_unidad_medida', \".\n\t\t\t\t\t\"Art.mascara_modulo as 'mascara_modulo', \".\n\t\t\t\t\t\"Cert.nombre as 'certificado', \".\n\t\t\t\t\t\"Cert.id_certificado as 'certificado_id', \".\n\t\t\t\t\t\"(Det.cantidad*Art.peso_unidad) as 'peso', \".\n\t\t\t\t\t( (!empty($campo_rec)) \n\t\t\t\t\t ? \"ROUND(Empart.$campo_rec,\".$this->tot_decimals.\") as 'PVP_rec', \"\n\t\t\t\t\t : '').\n\t\t\t\t\t\"Empart.stock as 'control_stock', \".\n\t\t\t\t\t\"Empart.stock_ficticio as 'stock_estimado', \".\n\t\t\t\t\t\"SUM(La.cantidad) as 'stock_real', \".\n\t\t\t\t\t( ($this->_aPedido['id_pedido'])\n\t\t\t\t\t\t? \"Empart.$campo_accion as 'precio_real', \"\n\t\t\t\t\t\t: \"\" ).\n\t\t\t\t\t\"Empart.dto_vol as 'dto_volumen', \".\n\t\t\t\t\t\"Empart.dto_vol_bultos as 'dto_volumen_bultos', \".\n\t\t\t\t\t\"Empart.unidades_bulto as 'unidades_bulto', \".\n\t\t\t\t\t\"Empart.bultos_capa_palet as 'bultos_capa_palet', \".\n\t\t\t\t\t\"Empart.capas_palet as 'capas_palet', \".\n\t\t\t\t\t\"Empart.servicios_duracion_precio as 'servicios_duracion_precio', \".\n\t\t\t\t\t\"Iva.id_iva as 'id_iva', \".\n\t\t\t\t\t\"Iva.porcentaje as 'porcentaje', \".\n\t\t\t\t\t\"Iva.recargo_equivalente as 'recargo_equivalente' \".\n\t\t\t\t\t\"FROM Lineas_detalle `Det`, Articulos `Art` LEFT JOIN Localizacion_articulos La ON (Art.id_articulo=La.id_articulo) \".\n\t\t\t\t\t\"LEFT JOIN Unidades_medida Um ON (Art.id_unidad_medida=Um.id_unidad_medida) \".\n\t\t\t\t\t\"LEFT JOIN Certificados Cert ON (Art.id_certificado=Cert.id_certificado), \".\n\t\t\t\t\t\"Familia_articulos `Fam`, Marcas `Mca`, Tipos_IVA `Iva`, \".\n\t\t\t\t\t\"Empresas_articulos `Empart`, Pedidos `Ped` \".\n\t\t\t\t\t\"WHERE Ped.id_pedido = $id AND Ped.id_pedido = Det.id_pedido AND \".\n\t\t\t\t\t\"Empart.id_articulo=Art.id_articulo AND Empart.id_empresa = Ped.id_empresa AND Art.id_marca = Mca.id_marca AND \".\n\t\t\t\t\t\"Det.id_articulo=Art.id_articulo AND Art.id_iva=Iva.id_iva AND Art.id_familia = Fam.id_familia \".\n\t\t\t\t\t\"GROUP BY id_detalle \".\n\t\t\t\t\t\"ORDER BY id_detalle asc \";\n\t\t$id_res = $oDb->query($cons);\n\t\t$this->_aIdxToAlb = array();\n\t\tif ($oDb->num_rows($id_res)) {\n\t\t\t$retval = TRUE;\n\t\t\t$this->_aDetalles = array();\n\t\t\t$total_bruto = 0;\n\t\t\t$total_peso = 0;\n\t\t\tfor($i = 1; $fila = $oDb->fetch_assoc($id_res); $i++ ) {\n\t\t\t\tif (!empty($campo_rec)) $fila['PVP_rec'] = $this->_applyRevenue($fila['PVP_rec'],$fila['porcentaje']);\n\t\t\t\tif ($fila['monto']>0) $fila['tipo_descuento_fmt'] = Document::format_number($fila['descuento'],$this->tot_decimals,true).\" $leyenda_divisa \";\n\t\t\t\telseif ($fila['descuento']>0) \n\t\t\t\t\t$fila['tipo_descuento_fmt'] = Document::format_number($fila['descuento'],$this->tot_decimals,true).\" % \";\n\t\t\t\t$this->_aDetalles[$i] = $fila;\n\n\t\t\t\t$aAlb = $this->getDeliveryFromDbDet($fila['id_detalle']);\n\t\t\t\tif (sizeof($aAlb))\n\t\t\t\t\tforeach ($aAlb as $ida) {\n\t\t\t\t\t\tif (!is_array($this->_aIdxToAlb[$i])) $this->_aIdxToAlb[$i] = array();\n\t\t\t\t\t\tarray_push($this->_aIdxToAlb[$i],$ida);\n\t\t\t\t\t}\n\n\t\t\t\t$total_bruto += $fila['base_imponible'];\n\t\t\t\t$total_peso += $fila['peso'];\n\t\t\t}\n\t\t\t$this->_aTotales['bruto'] = $total_bruto;\n\t\t\t$this->_aPedido['peso'] = $total_peso;\n\t\t} else $retval = FALSE;\n\n\t\treturn $retval;\n\t}",
"private function getComisionDia($tid=null,$fecha=false){\ndate_default_timezone_set('America/Lima');\n/* pago por Sot validadas*/\n$this->atendidos =$this->_ci->msolicitudes->solicitudes_encuestas($tid, 2, false,$fecha);\n$rcosto=$this->_ci->mcostosot->getSotByType(self::id_tipo,count($this->atendidos));\nif (!empty($rcosto)){\n $this->monto_sot=$rcosto[0]->monto;\n $pago_sot_validado=$rcosto[0]->monto;\n}\nelse\n $pago_sot_validado=0;\n\n/* descuento de inasistencias*/\n $date=($fecha==false)? date('Y-m-d'):$fecha;\n $desc_inasistencia=0;\n $monto_desc_asistencia=0;\n $r_asistencia=$this->_ci->masistencia->getAsistenciaByIdAndMonth($tid,$date);\n\n if(!empty($r_asistencia)){\n foreach ($r_asistencia as $key => $value) {\n if ($value->descanso==1){\n $dia_semana = $this->dias[date('N', strtotime($date))-1];\n $monto_desc_asistencia = $monto_desc_asistencia+$this->_ci->mpenalidades->getPenalidadesById(($dia_semana=='Domingo')? self::CODIGO_ASISTENCIA2 : self::CODIGO_ASISTENCIA1); \n }\n \n }\n }\n $desc_inasistencia=$monto_desc_asistencia;\n \n\n/* descuento por RF no validada*/\n $c=0;\n $monto_desc_rf = $this->_ci->mpenalidades->getPenalidadesById(self::CODIGO_RF); \n foreach ($this->atendidos as $key => $value) {\n $rf=$this->_ci->msolicitudes->solicitudesByIdAndDate($key);\n if ($rf==1)\n $c++;\n } \n $desc_rf_no_validada=$monto_desc_rf*$c;\n\n return $pago_sot_validado - $desc_inasistencia - $desc_rf_no_validada;\n}",
"public function preparaantesdeguardaritemcompra($modelodetalle){\n $cadenita=\"\";\n\n if(($modelodetalle->docompra_ocompra->codestado='10') or ($modelodetalle->docompra_ocompra->codestado='20')){\n if($modelodetalle->cambio()) {\n if($this->hubocambiossensibles($modelodetalle,array('codart','punit','cant','estadodetalle'))) {\n if($modelodetalle->cantidadentregada == 0) {\n if(!is_null($modelodetalle->iddesolpe)) { ///NO ES UN ITEM LIBRE\n\n ///vERIFICAR LA CONSIUSTENCIA DEL VALOR DEL PARAMETRO ENTREGADO\n $registrodetallesolpe=Desolpe::model()->findByPk($modelodetalle->iddesolpe);\n if(!is_null($registrodetallesolpe)){\n if($registrodetallesolpe->desolpe_solpe->escompra !='1' or is_null($registrodetallesolpe->idreserva) ){\n ///Actualizar los datos aguas arriba (SOLPES Y RESERVAS)\n\n\n $registrodetallesolpe->SetScenario('cambiaestado');\n $registroreserva=Alreserva::model()->findByPk($registrodetallesolpe->idreserva);\n if( !is_null($registroreserva)) {\n $registroreserva->SetScenario('cambiaestado');\n //Ahora vamos por la solpe que genero la reserva\n $registrodetallesolpeoriginal=Desolpe::model()->findByPk($registroreserva->hidesolpe);\n if( !is_null($registrodetallesolpeoriginal)) {\n\n $registrodetallesolpeoriginal->SetScenario('cambiaestado');\n\n ///Verificando las compras en DESOLPECOMPRA\n $cantidad_comprada=$registrodetallesolpe->cantcompras;\n if($cantidad_comprada > 0) ///SI YA HABIDO ATENCIONES EN LA TABLA DESOLPECOMPRA\n {\n\n $setratadeanulacion=false;\n if(($modelodetalle->oldattributes['estadodetalle'] <> '40') and ($modelodetalle->estadodetalle=='40'))\n { ///Si se trata de una anulacion hay que anular el registro de DESOLPECOMPRA\n $nuevocriterio=New CDbcriteria;\n $nuevocriterio->addCondition(\"iddesolpe=:xiddesolpe AND iddocompra=:xiddocompra \");\n $nuevocriterio->params=array(':xiddesolpe'=>$modelodetalle->iddesolpe,':xiddocompra'=>$modelodetalle->id);\n $modelodesolpecompra=Desolpecompra::model()->find($nuevocriterio);\n $modelodesolpecompra->codestado='30'; //ANULAR ......!!!!\n if(!$modelodesolpecompra->save())\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : No se pudo anular el registro de Detalles-solicitudes/Detalle-compras <br>\";\n $setratadeanulacion=true;\n }\n\n\n if( $cantidad_comprada +$modelodetalle->cant ==$registrodetallesolpe->cant)\n {\n //Es una atencion unica el caso mas simple, uno a uno\n ///Verificar si se trata de una anulacion\n if($setratadeanulacion)\n {\n ///El proceso retrocede, hayq ue anular tambien el registro de la tab la puente DESOLPECOMPRA\n /// y revertir los estados\n $registrodetallesolpe->est='30'; //APROBADO\n $registroreserva->estadoreserva='20'; //EN PROICESO DE COMPRA X Q LA SOLPE AUN PERMANECE COMO APROBADA\n $registrodetallesolpeoriginal->est='70'; ///EN PROCESO DE COMPRA X Q LA RESERVA Y LA SOLPE AUN ESTAN VIGENTES\n\n\n } else { ///Si no se trata de una anulacion el proceso \"evoluciona\"\n $registrodetallesolpe->est='40'; //ATENDIDO\n $registroreserva->estadoreserva='50'; //COMPRADO TOTALMENTE\n $registrodetallesolpeoriginal->est='90'; ///Comprado totalmente\n }\n\n\n\n\n } else { //Significa que conn esta compra aun falta o se han excedido..veamos\n if( $cantidad_comprada +$modelodetalle->cant < $registrodetallesolpe->cant) {\n // En este caso se esta comprando pero aun falta completar, un abastecimiento parcial\n $registrodetallesolpe->est='70'; //EN COMPRA\n $registroreserva->estadoreserva='60'; //EN COMPRA\n\n } else { ///Error se pasaron de la cantidad solicitada\n ///Error\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : Se esta comprando : (\".($cantidad_comprada +$modelodetalle->cant).\") mas de lo que se solicito :(\".$registrodetallesolpe->cant.\") en la solicitud \".$registrodetallesolpe->desolpe_solpe->nunero.\"-\".$registrodetallesolpe->item.\" <br>\";\n\n\n }\n\n }\n\n } else { ///qUIER DECIR QUE ES LA PRIMERA VEZ QUE SE ATENDERIA ESTE ITEM\n\n }\n $registrodetallesolpeoriginal->save();\n } else { //Error no se pudo ubicar el detalle de la Solpe Padre\n //eRRROR\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : No se pudo encontrar la solicitud original (Imputada) asociada (\".$registroreserva->hidesolpe.\") <br>\";\n\n }\n $registroreserva->save();\n } else { //Error no se ecnontro la reserva que genero la solpe de aprovisionamiento\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : No se pudo encontrar la reserva asociada <br>\";\n\n }\n $registrodetallesolpe->save();\n } else {///Error , La solpe no es de aprovisionamiento o tiene el campo idererva vacio lo qaue quiere decir que no es una solpe de aprovisionamiento\n ///Error\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : La solicitud asociada \".$registrodetallesolpe->desolpe->solpe->numero.\"-\".$registrodetallesolpe->item.\" no es de àprovisionamiento <br>\";\n\n }\n } else {///Error , este detakke de solped no existe\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : No se pudo encontrar la solicitud asociada -> (\".$modelodetalle->iddesolpe.\") <br>\";\n\n }\n /*}else{ // ($modelodetalle->cantsolpes) =0 ES LA PRIMERA ATENCION , OSEA NO HAY REGISTROS EN DESOLPECOMPRA\n\n }*/\n\n } else { //ES UN ITEM LIBRE\n\n return $cadena;\n }\n\n\n } else { //HAY enetregas\n $cadena.=\" El item \".$modelodetalle->item.\" - \".$modelodetalle->descri.\" : Ya tiene entregas y no es posible modificar estos datos sensibles <br>\";\n\n\n }\n\n } else { //No ha habido cambios sensibles\n ///Dara fin al procedimiento\n return $cadena;\n }\n\n } else { //Terminar el procediiento\n ///Dara fin al procedimiento\n return $cadena;\n }\n }\n\n }",
"function e12cMaisDetalhesFinanceiro($s_usuario, $codigo,$pagadora,$beneficiario,$valor,$emissao,$vencimento,$mensagem,$id_msg){\n $query = \"SELECT TOP 1\n e.id_usuario AS id_para\n ,e.nome AS nome_para\n ,e.sobrenome AS sobrenome_para\n ,e.email AS email_para\n ,u.id AS id_de\n ,u.nome AS nome_de\n ,u.sobrenome AS sobrenome_de\n ,u.usuario AS email_de\n ,CONVERT(varchar,GETDATE(),105) AS dataAprov\n FROM configuracao_email_disparo AS e\n LEFT JOIN usuario AS u ON u.id = ?\n WHERE tipo_disparo=410\n ORDER BY e.id \";\n $params = array($s_usuario);\n $resul = sqlsrv_query($this->link, $query, $params);\n $linha = sqlsrv_fetch_object($resul);\n $id_de = $linha->id_de;\n $nome_de = $linha->nome_de;\n $sobrenome_de = $linha->sobrenome_de;\n $email_de = $linha->email_de;\n $id_para = $linha->id_para;\n $nome_para = $linha->nome_para;\n $sobrenome_para = $linha->sobrenome_para;\n $email_para = $linha->email_para;\n $dt_aprov = $linha->dataAprov;\n //\n $tituloEmail = 'Notificação financeira - Solicitação de maiores detalhes do título ['.$codigo.']';\n //\n\n $corpo = file_get_contents(\"../pages/email/e12c_fin_det.html\", true);\n $corpo = str_replace(\"[[NOME_PARA]]\", $nome_para.' '.$sobrenome_para, $corpo);\n $corpo = str_replace(\"[[NOME_DE]]\", $nome_de.' '.$sobrenome_de, $corpo);\n $corpo = str_replace(\"[[EMAIL_DE]]\", $email_de, $corpo);\n $corpo = str_replace(\"[[PAGADORA]]\", $pagadora, $corpo);\n $corpo = str_replace(\"[[BENEFICIARIO]]\", $beneficiario, $corpo);\n $corpo = str_replace(\"[[VALOR]]\", $valor, $corpo);\n $corpo = str_replace(\"[[EMISSAO]]\", $emissao, $corpo);\n $corpo = str_replace(\"[[VENCIMENTO]]\", $vencimento, $corpo);\n $corpo = str_replace(\"[[CODIGO]]\", $codigo, $corpo);\n $corpo = str_replace(\"[[MENSAGEM]]\", $mensagem, $corpo);\n\n //enviando email\n $objEmail = new email();\n $val1id_email = $objEmail->enviaEmailCopia($tituloEmail, $corpo, $nome_para, $email_para,$nome_de, $email_de);\n\n //3-GRAVANDO LOG\n $objLog = new log();\n $valid_Log=$objLog->logEmailMaisDetalhesFinanceiro($s_usuario,$id_de,$id_para,$id_msg);\n\n if ($val1id_email == 1 && $valid_Log==1) {\n return 1;\n }else{\n return 0;\n }\n\n }",
"static function descuento_tienda () {\n\n // ATENCIONN !!! Para jugar con fechas la SINTAXIS es de asi\n if (date(\"m-d-y\")>\"06-09-19\") { // Si la fecha corresponde a despues del 9 de junio del 2019 entonces se aplica el descuento\n\n self :: $desc_tienda = 4500; // en caso de ser llamado se aplicara el descuento y este valor reemplazara al valor real de la variable global.\n\n }\n }",
"function obtener_datos_responsable_aula (){\n //a) el legajo de un docente. \n //b) el id_organizacion.\n //Vamos a hacer uso de las funciones que ya tenemos implementadas en el datos_tabla persona.\n if(strcmp($this->s__datos_solcitud['tipo_agente'], 'Docente')==0){\n //Guardamos los datos del responsable de aula en sesion para poder freezarlos en la base de datos\n //rukaja.\n $this->s__datos_responsable=$this->dep('datos')->tabla('persona')->get_datos_docente($this->s__datos_solcitud['id_responsable']);\n }else{\n $datos_org=$this->dep('datos')->tabla('persona')->get_datos_organizacion($this->s__datos_solcitud['id_responsable']);\n $datos_org['apellido']=\"----------\";\n $copy=$datos_org['id_organizacion'];\n //Renombramos el el id_organizacion para no tener que modificar el formulario en el toba_editor\n //o la consulta sql del datos_tabla.\n $datos_org['legajo']=$copy;\n //Guardamos los datos del responsable de aula en sesion para poder freezarlos en la base de datos\n //rukaja.\n $this->s__datos_responsable=$datos_org;\n }\n }",
"public function MostrarDetalle($idcompra){\r\n\r\n $sql=\"SELECT\r\n dc.idcomprad,\r\n dc.idarticulo,\r\n dc.iddeposito,\r\n dc.idartunidad,\r\n a.cod_articulo,\r\n a.desc_articulo,\r\n u.desc_unidad,\r\n a.tipo,\r\n dc.cantidad,\r\n CONVERT(dc.costo,DECIMAL(12,2)) AS costo,\r\n CONVERT(dc.tasa,DECIMAL(12,0)) AS tasa,\r\n IFNULL((SELECT cantidad FROM tbstock WHERE iddeposito=dc.iddeposito AND idarticulo=a.idarticulo),0) AS disp,\r\n au.valor\r\n FROM tbcomprad dc \r\n INNER JOIN tbarticulo a ON a.idarticulo=dc.idarticulo\r\n INNER JOIN tbartunidad au ON au.idartunidad=dc.idartunidad\r\n INNER JOIN tbunidad u ON u.idunidad=au.idunidad\r\n WHERE dc.idcompra='$idcompra'\";\r\n return ejecutarConsulta($sql);\r\n }",
"function createnew_descuento( $iddescuento, $idtarjeta, $descripcion, $arancel, $habilitado, $_usuario, $_fechamodifica ) {\n\n // items to be inserted in the database \n $_obj = array($iddescuento,\n$idtarjeta,\n$descripcion,\n$arancel,\n$habilitado,\n$_usuario,\n$_fechamodifica); \n\n // database object connection\n $dbConn = $GLOBALS['dbConn'];\n\n // perform insert in the database\n $dbConn->insert(\"systarjetas.descuento\", $_obj);\n return $this->get_idinsertdescuento();\n }",
"public static function getTblcoloniaByTblproveedor($idtblciudad,$idtbltipodeservicio,$fechapedido,$codipost){\n\n \tdate_default_timezone_set(\"America/Monterrey\");\n $activado=1;\n $fechapedidoingresada = new DateTime($fechapedido);\n $fechahoy = new DateTime(date(\"d-m-Y\"));\n $interval= $fechahoy->diff($fechapedidoingresada);\n \t\t$diasMinimos= $interval->format('%d');\n \t\t\n \t\t$diasemana= $fechapedidoingresada->format('l');\n\n \t\t\n \t\t$tipopedidoCompleto=3;\n $tipodeservicioCompleto=3;\n \n\n if($fechapedidoingresada == $fechahoy)\n { \n $tipodepedido= 1; //pedidoparahoy\n $stock=1;\n \t}else\n \t{\n \t\t$tipodepedido= 2; //pedidoparaotrodia\n \t\t$stock=0;\n \t}\n \n \n if($idtbltipodeservicio==1){ //Entrega en Pasteleria\n $consulta = \"SELECT TC.* FROM tblcolonia TC\n\t\t\tINNER JOIN tblproveedor TP ON TC.idtblcolonia = TP.tblcolonia_idtblcolonia \n\t\t\tINNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n\t\t\tINNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto \n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana\n\t\t\t WHERE TC.tblciudad_idtblciudad = ?\t\t\n \tAND TP.tblproveedor_activado = ?\n \tAND TPR.tblproducto_activado = ?\n \tAND (TP.tbltiposervicio_idtbltiposervicio = ? OR TP.tbltiposervicio_idtbltiposervicio = ? ) \n \tAND TPRD.tblproductdetalle_activado = ?\n \tAND TPRD.tblproductdetalle_stock >= ?\n \tAND TPRD.tblproductdetalle_diaselaboracion <= ?\n AND TDS.tbldiasemana_dia = ?\n \tGROUP BY TC.idtblcolonia\";\n\t\t\t\t\t \n\t\t\ttry{\n\t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n\t\t\t $resultado->bindParam(1,$idtblciudad,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(4,$idtbltipodeservicio,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(5,$tipodeservicioCompleto,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(6,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(7,$stock,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(8,$diasMinimos,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(9,$diasemana,PDO::PARAM_STR);\n\t\t\t $resultado->execute();\n\t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t } catch(PDOException $e){\n\t\t\t return false;\n\t\t\t \n\t\t\t }\n \n \n }else {//Entrega en Domicilio\n $consulta = \"SELECT TC.* FROM tblcolonia TC, tblproveedor TP \n INNER JOIN tblcoloniaprovservicio TCPS ON TP.idtblproveedor = TCPS.tblproveedor_idtblproveedor\n\t\t\t\t INNER JOIN tblproducto TPR ON TPR.tblproveedor_idtblproveedor = TP.idtblproveedor \n\t\t\t\t INNER JOIN tblproductdetalle TPRD ON TPR.idtblproducto = TPRD.tblproducto_idtblproducto\n INNER JOIN tbldiaprovservicio TDP ON TDP.tblproveedor_idtblproveedor = TP.idtblproveedor\n INNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDP.tbldiasemana_idtbldiasemana \n\t\t\t WHERE TC.tblciudad_idtblciudad = ?\n\t\t\t\t\t\t\t\t\t\t AND TC.idtblcolonia = TCPS.tblcolonia_idtblcolonia\t\n \t\t\t\t AND TP.tblproveedor_activado = ?\n \t\t\t\t AND TPR.tblproducto_activado = ?\n \t\t\t\t AND TPRD.tblproductdetalle_activado = ?\n \t\t\t\t AND TPRD.tblproductdetalle_stock >= ?\n \t\t\t\t AND TPRD.tblproductdetalle_diaselaboracion <= ?\n \t\t\t\t AND TDS.tbldiasemana_dia = ?\n\t\t\t\t AND TC.tblcolonia_codipost = ?\n\t\t\t\t\t GROUP BY TC.idtblcolonia\";\t \n\t\t\t\t\t \n\t\t\ttry{\n\t\t\t $resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n\t\t\t $resultado->bindParam(1,$idtblciudad,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(2,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(3,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(4,$activado,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(5,$stock,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(6,$diasMinimos,PDO::PARAM_INT);\n\t\t\t $resultado->bindParam(7,$diasemana,PDO::PARAM_STR);\n\t\t\t $resultado->bindParam(8,$codipost,PDO::PARAM_INT);\n\t\t\t $resultado->execute();\n\t\t\t return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n\t\t\t} catch(PDOException $e){\n\t\t\t return false; \n \t} \n }\t\t\t\t\t\t\t\t\t\n }",
"function verPedidosDelDia($Fecha){\n\t\t$arreglo = array(\"success\"=>\"false\",\"data\"=>\"\",\"error\"=>\"No hay registros\");\n\t\t$db = getConexionTda();\n\t\t$sRetorno ='';\n\t\tif ($db->getError() == '') {\n\t\t\t$rs = $db->query(\"select * from fn_pedidosacredito_select('$Fecha'::DATE) ORDER BY region DESC;\");\n\t\t\tif ($db->getError() != \"\") {\n\t\t\t\t$sRetorno =$db->getError();\n\t\t\t\t$arreglo['success'] = false;\n\t\t\t\t$arreglo['error'] = $sRetorno;\n\t\t\t}else{\n\t\t\t\t$i = 0;\n\t\t\t\t$iEncabezado = 0;\n\t\t\t\t$opcion = '';\n\t\t\t\t$pagina1 = 19;\n\t\t\t\tforeach ($rs AS $valor) {\n\t\t\t\t\tif ($iEncabezado == 0){\n\t\t\t\t\t\t$iEncabezado = 1;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$opcion .= '<div class=\"table-responsive\"></tr>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$vColonia ='';\n\t\t\t\t\tif ($valor['colonia'] !=''){\n\t\t\t\t\t\t$vColoniaArray = explode( ' - ', $valor['colonia']);\n\t\t\t\t\t\t$vColonia = ISSET($vColoniaArray[1])?$vColoniaArray[1]:'';\n\t\t\t\t\t}\n\t\t\t\t\t$vTotal = $valor['total'];\n\t\t\t\t\t$opcion .= '<tr id=\"'.$valor['num_foliopedido'].'\" title=\"'.$valor['num_foliopedido'].'\"><td><table cellspacing=\"0\" cellpadding=\"0\" class=\"table-condensed\" style=\"width:100%;margin: 0px 0px 0px 0px;padding:0px;border-spacing: 0px 0px;border: 0px;\"></td><tr>';\n\t\t\t\t\t$opcion .= '<td name=\"detalle\" style=\"font-family:Arial;font-size:11px;\"><strong>ARTICULOS:</strong> <label id=\"detalle\">'.$valor['detallepedido'].'</label> <span >. ';\n\t\t\t\t\t/*if($valor['descuento'] !== 1){\n\t\t\t\t\t\tif ($vTotal > $valor['abono']){\n\t\t\t\t\t\t\tif ($valor['abono'] > 0){\n\t\t\t\t\t\t\t\t//$folioConsulta = $valor['foliopedido'];\n\t\t\t\t\t\t\t\t$vRecibio = '';\n\t\t\t\t\t\t\t\t$vRecibio = quienAbonoXFolio($folioConsulta);\n\t\t\t\t\t\t\t\t$vRecibio = $vRecibio['data'];\n\t\t\t\t\t\t\t\tif ($vRecibio != ''){\n\t\t\t\t\t\t\t\t\t$vRecibio = ' POR:'.$vRecibio;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$opcion .= 'TOTAL: $<label id=\"importe_total\">'.$vTotal.'</label>'.$vDeposito.'</span> ABONO: $<label id=\"importe_abono\">'.$valor['abono'].$vRecibio.'</label> RESTAN: $<label id=\"importe_abono\">'.(($vTotal) - ($valor['abono'])).'</label>';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$opcion .= 'TOTAL: $<label id=\"importe_total\">'.$vTotal.'</label>'.$vDeposito.'</span> ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$folioConsulta = $valor['foliopedido'];\n\t\t\t\t\t\t\t$vRecibio = '';\n\t\t\t\t\t\t\t$vRecibio = quienAbonoXFolio($folioConsulta);\n\t\t\t\t\t\t\t$vRecibio = $vRecibio['data'];\n\t\t\t\t\t\t\tif ($vRecibio != ''){\n\t\t\t\t\t\t\t\t$vRecibio = ' POR:'.$vRecibio;\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t$opcion .= 'TOTAL: $<label id=\"importe_total\">'.$vTotal.'</label>'.$vDeposito.'</span> PAGADO '.$vRecibio.' ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$opcion .= 'TOTAL: $NO COBRAR';\n\t\t\t\t\t}*/\n\t\t\t\t\t$opcion .= '</br><label id=\"calle\"><strong>DOMICILIO:</strong> '.$valor['calle'].'</label> <label id=\"numero_ext\">'.$valor['numext'].'</label> <label id=\"numero_int\">'.$valor['numint'].'</label>, <label id=\"colonia\"><strong> '.$vColonia.'</strong></label><span style=\"font-size: 9px;\"> <label id=\"referencias\">'.$valor['referencias'].'.</span></label> ';\n\t\t\t\t\t$opcion .= '</br><label id=\"nombre\" class=\"semi-bold\"><strong>CLIENTE:</strong> '.$valor['nombrecte'].' '.$valor['apellidocte'].'</label> | <label id=\"ciudad\">'.$valor['telefonocasa'].' / '.$valor['telefonocelular'].'</label>| FOLIO: <label id=\"folio\">'.$valor['num_foliopedido'].'</label>';\t\n\t\t\t\t\t$opcion .= '</br><strong>FECHA:</strong> <label id=\"fecha_venta\">'.$valor['fecha_venta'].'</label> | <strong>TIPO PAGO:</strong> <label id=\"tipopago\">'.$valor['nom_tipopago'].'</label>';\n\t\t\t\t\t$opcion .= ' | <strong>PLAZO:</strong> <label id=\"plazo\">'.$valor['nom_plazo'].'</label>';\n\t\t\t\t\t$opcion .= ' | <strong>COBRO:</strong> <label id=\"plazo\">'.$valor['nom_periodocobro'].'</label>';\n\t\t\t\t\t$opcion .= '</br><strong>VENDEDOR:</strong> <label id=\"nom_ejecutivo\">'.$valor['nom_ejecutivo'].'</label>';\n\t\t\t\t\t$opcion .= '| <strong>SUPERVISOR:</strong> <label id=\"nom_supervisor\">'.$valor['nom_supervisor'].'</label>';\n\t\t\t\t\t$opcion .= '| <strong>JEFE GPO:</strong> <label id=\"nom_jefegpo\">'.$valor['nom_jefegpo'].'</label>';\n\t\t\t\t\t$opcion .='</td>';\n\t\t\t\t\t\n\t\t\t\t\t$opcion .= '<td class=\"pull-right\" name=\"controles\" id=\"controles_'.$valor['num_foliopedido'].'\" style=\"display:none\"><div class=\"btn-group-vertical\">';\n\t\t\t\t\t$opcion .= '<button type=\"button\" title=\"Cancelar el pedido\" class=\"btn btn-info btn-xs noMostrarPrint\" name=\"'.$valor['num_foliopedido'].'\" href=\"javascript:void(0);\" id=\"smart-mod-eg1\" onclick=\"MensajeSmartModPedidos('.$valor['num_foliopedido'].',2);\"><i class=\"fa fa-trash-o\"> </i>Cancelar</button><br/>';\n\t\t\t\t\t$opcion .= '<a id=\"recibirpedido\" href=\"#ajax/modal_abonos.php?id='.$valor['num_foliopedido'].'\" title=\"Recibe abonos y mercancias\" type=\"button\" class=\"btn btn-primary btn-xs noMostrarPrint\"><i class=\"fa fa-edit\"> </i>Recibir</a><br/>';\n\t\t\t\t\t$opcion .= '<button type=\"button\" title=\"Imprimir comprobante\" class=\"btn btn-info btn-xs noMostrarPrint\" name=\"'.$valor['num_foliopedido'].'\" onclick=RedirectPage(\"#ajax/imprimir_comprobantepedido.php?f='.$valor['num_foliopedido'].'&n='.$vTotal.'\"); id=\"smart-mod-eg1\"><i class=\"fa fa-edit\"> </i>Comprobante</button><br/>';\n\t\t\t\t\t\n\t\t\t\t\t$opcion .= '<a id=\"modificarcobranza\" href=\"#ajax/modal_cambiarfechacobranza.php?id='.$valor['num_foliopedido'].'&d='.$Fecha.'\" title=\"Modificar la cobranza\" type=\"button\" class=\"btn btn-primary btn-xs noMostrarPrint\"><i class=\"fa fa-edit\"> </i>Modificar dia cobranza</a><br/></div>\t';\n\t\t\t\t\t//$opcion .= '<button type=\"button\" title=\"Modificar cobranza\" class=\"btn btn-info btn-xs noMostrarPrint\" name=cobro\"'.$valor['num_foliopedido'].'\" onclick=RedirectPage(\"#ajax/modal_cambiarfechacobranza.php?f='.$valor['num_foliopedido'].'&d='.$Fecha.'\"); id=\"smart-mod-eg1\"><i class=\"fa fa-edit\"> </i>Modificar cobranza</button></div></td>';\n\t\t\t\t\t$opcion .= '<tr/>';\n\t\t\t\t\t$opcion .= '<hr style=\"margin:0px 0px 0px 0px;padding:0px;\"></table>';\n\t\t\t\t\tif ($i == $pagina1){\n\t\t\t\t\t\t$pagina1 = 21;\n\t\t\t\t\t\t$i = 0;\n\t\t\t\t\t\t$opcion .= '<br/><br/>';\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$opcion .= '</tr></div>';\n\t\t\t\t\n\t\t\t\t$arreglo['success'] = true;\n\t\t\t\t$arreglo['data'] = $opcion;\n\t\t\t\t$arreglo['error'] = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$sRetorno =$db->getError();\n\t\t\t$arreglo['success'] = false;\n\t\t\t$arreglo['error'] = $sRetorno;\n\t\t}\n\t\tcloseConexion($db);\n\t\treturn $arreglo;\n\t}",
"static public function ctrDescargarCotizacion(){\r\n\r\n\t\tif(isset($_GET[\"idCotizacion3\"]) && $_GET[\"opcion\"] == 1){\r\n\r\n\t\t\t$tabla = \"cotizaciones\";\r\n\t\t\t$datos = array(\"folio\" => $_GET[\"idCotizacion3\"]);\r\n\r\n\t\t\t$tabla1 = \"bitacora\";\r\n\t\t\t$datos1 = array(\"usuario\" => $_SESSION[\"nombre\"],\r\n\t\t\t\t\t\t\t\t \"perfil\" => $_SESSION[\"perfil\"],\r\n\t\t\t\t\t\t\t\t \"accion\" => 'Descarga de Cotizacion',\r\n\t\t\t\t\t\t\t\t \"folio\" => $_GET[\"idCotizacion3\"]);\r\n\r\n\t\t\t\r\n\r\n\r\n\t\t\t$respuesta = ModeloCotizaciones::mdlDescargarCotizacion($tabla, $datos);\r\n\t\t\t$respuesta1 = ModeloCotizaciones::mdlRegistroBitacoraCancelar($tabla1, $datos1);\r\n\r\n\t\t\tif($respuesta == \"ok\" && $respuesta1 == \"ok\"){\r\n\r\n\t\t\t\techo'<script>\r\n\r\n\t\t\t\tswal({\r\n\t\t\t\t\t type: \"success\",\r\n\t\t\t\t\t title: \"La cotización ha sido descargada\",\r\n\t\t\t\t\t showConfirmButton: true,\r\n\t\t\t\t\t confirmButtonText: \"Cerrar\",\r\n\t\t\t\t\t closeOnConfirm: false\r\n\t\t\t\t\t }).then(function(result) {\r\n\t\t\t\t\t\t\t\tif (result.value) {\r\n\r\n\t\t\t\t\t\t\t\twindow.location = \"cotizador\";\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t</script>';\r\n\r\n\t\t\t}\t\t\r\n\r\n\t\t}\r\n\r\n\t}",
"public function obtener_info_completa($id)\n {\n $resultado = null;\n $conexion = abrir_conexion();\n if ($conexion !== null) {\n try {\n $sql = \"SELECT Distinct c.id,c.paciente_id,p.nombre as nombre,p.apellido as apellido,c.fecha,m.nombre as motivo,i.nombre as institucion,c.articulacion_con_instituciones,c.internacion,\n c.diagnostico,c.observaciones,tf.nombre as tratamiento_farmacologico,tf.id as tratamiento_farmacologico_id,a.nombre as acompanamiento,td.nombre as tipo_documento,p.numero as documento,\n p.nro_historia_clinica as historia_clinica\n FROM consulta c LEFT JOIN motivo_consulta m ON(c.motivo_id=m.id)\n LEFT JOIN institucion i ON (c.derivacion_id=i.id)\n LEFT JOIN tratamiento_farmacologico tf ON(c.tratamiento_farmacologico_id=tf.id)\n LEFT JOIN acompanamiento a ON(c.acompanamiento_id=a.id)\n INNER JOIN paciente p ON(c.paciente_id=p.id)\n LEFT JOIN tipo_documento td ON(p.tipo_doc_id=td.id)\n WHERE c.id=:id AND c.borrado=0\";\n $sentencia = $conexion->prepare($sql);\n $sentencia->bindParam(\":id\", $id);\n $sentencia->execute();\n $resultado = $sentencia->fetch(PDO::FETCH_ASSOC);\n } catch (PDOExeption $ex) {\n throw new Exception(\"error obtener_info_completa \" . $ex->getMessage());\n }\n }\n $conexion = null;\n return $resultado;\n }",
"public static function getTBCDAndsetCheckTBHCD($cupondescuento, $idtblcliente, $idtblordencompra){\n\n \t$conexionPDO = ConexionDB::getInstance()->getDb(); \n \t$activado =1;\n \t$clienteregistrado=1;\n \t$tipocliente='';\n \t$ciudad='';\n\n \t//se obtiene la fecha/hora actual\n $fchactual = new DateTime(\"now\", new DateTimeZone('America/Mexico_City'));\n $fchactual = $fchactual->format('Y-m-d');\n\n //SE busca si el cupon exite y es valido en su fecha de expiracion \n $consultaCupon = \"SELECT * FROM tblcupondescuento \n \t\t\t WHERE tblcupondescuento_codigo = ? AND \n \t\t\t \t\ttblcupondescuento_fchexpira>= ?\";\n try{\n\n \t$resultado = $conexionPDO->prepare($consultaCupon);\n\t\t\t$resultado->bindParam(1,$cupondescuento,PDO::PARAM_STR);\n\t\t\t$resultado->bindParam(2,$fchactual,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\t\t\t\t\t\n\t\t\t$existe = $resultado->fetchColumn(); //retorna el numero de count\n\n\t\t\t//si exite se procede a verificar que el cupon no este usado por el cliente\n\t\t\tif($existe>0){\t\t\t\t\n\t\t\t\t$checkH = \"SELECT COUNT(*) FROM tblhistcupondescuento WHERE tblhistcupondescuento_cupon = ? AND tblhistcupondescuento_idtblcliente = ?\";\n\n\t\t\t\t\t\t$resultado = $conexionPDO->prepare($checkH);\n\t\t\t\t\t\t$resultado->bindParam(1,$cupondescuento,PDO::PARAM_STR);\n\t\t\t\t\t\t$resultado->bindParam(2,$idtblcliente,PDO::PARAM_INT);\n\t\t\t\t\t\t$resultado->execute();\n\t\t\t\t\t\t$existe = $resultado->fetchColumn(); //retorna el numero de count\n\n\t\t\t\t\t\tif($existe>0){ //Existe un registro de uso de codigo con el cliente\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}else{ //De lo contrario del cupon se verifica si es cupon general o por proveedor , si es proveeedor checamso que su compra tenga producos de el mismo. \n\t\t\t\t\t\t\t$resultado = $conexionPDO->prepare($consultaCupon);\n\t\t\t\t\t\t\t$resultado->bindParam(1,$cupondescuento,PDO::PARAM_STR);\n\t\t\t\t\t\t\t$resultado->bindParam(2,$fchactual,PDO::PARAM_INT);\n\t\t\t\t\t\t\t$resultado->execute();\n\t\t\t\t\t\t\t$arrayCupon = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t\t\t\tforeach ($arrayCupon as $row ) {\n\t\t\t\t \t\t\t\t$tipoProveedor= (int)$row['tblcupondescuento_idtblproveedor'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//se regresa el registro de cupon porque es general\t\n\t\t\t\t\t\t\tif($tipoProveedor<=0){\n\n\t\t\t\t\t\t\t\treturn $arrayCupon;\n\n\t\t\t\t\t\t\t}else{//Se tiene que verificar que la orden tenga productos del proveedor que ofrece el cupon \n\n\t\t\t\t\t\t\t\t$checkOrden = \"SELECT COUNT(*) FROM tblordencompra TOC\n\t\t\t\t\t\t\t\t\tINNER JOIN tblcarritoproduct TCP ON TOC.idtblordencompra = TCP.tblcarritoproduct_idtblordencompra\n\t\t\t\t\t\t\t\t\tINNER JOIN tblproductdetalle TPD ON TCP.tblcarritoproduct_idtblproductdetalle = TPD.idtblproductdetalle\n\t\t\t\t\t\t\t\t\tINNER JOIN tblproducto TP ON TPD.tblproducto_idtblproducto = TP.idtblproducto\n\t\t\t\t\t\t\t\t\tWHERE TOC.idtblordencompra = ? AND TP.tblproveedor_idtblproveedor = ?\";\n\n\t\t\t\t\t\t\t\t\t$resultado = $conexionPDO->prepare($checkOrden);\n\t\t\t\t\t\t\t\t\t$resultado->bindParam(1,$idtblordencompra,PDO::PARAM_INT);\n\t\t\t\t\t\t\t\t\t$resultado->bindParam(2,$tipoProveedor,PDO::PARAM_INT);\n\t\t\t\t\t\t\t\t\t$resultado->execute();\n\t\t\t\t\t\t\t\t\t$existeProduct = $resultado->fetchColumn(); //retorna el numero de count\n\t\t\t\t\t\t\t\t\t//echo $existeProduct;\n\n\t\t\t\t\t\t\t\t\tif($existeProduct>0){ //se manda el cupon \n\t\t\t\t\t\t\t\t\treturn $arrayCupon;\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n }catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n \n }",
"function detalleProyecto($detalle){\n\t\t//$sqlConsult=\"SELECT id_tarea, titulo, mensaje, prioridad, fecha_creacion, hora_creacion, nombre , img_profile , porcentaje,status FROM proyectos LEFT JOIN cat_usuarios ON tareas.id_usuario = cat_usuarios.id WHERE id_tarea = '\".$detalle.\"'\";\n\t\t$sqlConsulResp=\"SELECT responsable FROM proyectos WHERE id='\".$detalle.\"'\";$cont=0;\n\t\t$resulResp=mysql_query($sqlConsulResp,$this->conectarBd());\n\t\t$respons = mysql_fetch_array($resulResp);\n\t\t$cadrespons = explode(\",\",$respons[\"responsable\"]);\n\t\tforeach($cadrespons as $valor){\n\t\t\t$sqlConNomResp=\"SELECT nombre, apaterno FROM userdbsistemas WHERE ID ='\".$valor.\"'\";\n\t\t\t$rNomResp=mysql_query($sqlConNomResp,$this->conectarBd());\n\t\t\t$resNom = mysql_fetch_array($rNomResp);\n\t\t\t$NomResp[$cont]=\"\".$resNom[\"nombre\"].\" \".$resNom[\"apaterno\"];\n\t\t\t//$todo=$todo.\"\".$NomResp;\n\t\t\t$cont++;\t\n\t\t}\n\t\t$sqlConsult=\"SELECT proyectos.id AS id,\tproyectos.nombre AS nombre, descripcion, fecha_inicio, fecha_vencimiento, observaciones, status, totalHoras, porcentaje, userdbsistemas.nombre AS nombreUsuario, apaterno FROM proyectos inner join userdbsistemas on proyectos.responsable=userdbsistemas.ID WHERE proyectos.id='\".$detalle.\"'\";\n\t\t$resulta=mysql_query($sqlConsult,$this->conectarBd());\t\n\t\t$row = mysql_fetch_array($resulta);\n\t\t$imgProfile=\"../../img/other_profile.png\";//.$row['img_profile'];\n?>\n\t\t<script type=\"text/javascript\"> $(\"#opcionesTitulo\").html('<?=$row[\"nombre\"]?>'); </script>\n\t\t<div style=\"border:1px solid #000; background:#666; color:#FFF; height:20px; padding:5px; font-size:10px;\">\n\t\t\t<a href=\"#\" onclick=\"detale('<?=$detalle;?>')\" style=\"color: #FFF;text-decoration: none;\">Actualizar Proyecto</a>\n\t\t</div>\n\t\t<div style=\"margin:4px; height:92%; font-size:10px;\">\n\t\t\t<div style=\"float:left; width:64px; height:64px; border:1px solid #F0F0F0; margin:5px; text-align:center;\"><img src=\"<?=$imgProfile;?>\" width=\"64\" border=\"0\" /></div>\n\t\t\t<div style=\"float:left;margin:5px; width:86%; height:auto;border:0px solid #000;\">\t\t\t\t\n\t\t\t\t<span style=\"font-weight:bold; font-size:14px; margin-left:5px;\">Resumen del proyecto:</span><br>\n\t\t\t\t<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"98%\" style=\"margin: 5px 5px 5px 0;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t\t\t<div style=\"height: 20px;padding: 10px;background: #F0F0F0;border: 1px solid #CCC;color:#666;font-weight: bold;font-size: 14px;\"><?=strtoupper($row[\"nombre\"]);?></div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n<?\n\t\t\t\tif($row[\"prioridad\"]==\"alta\"){\n?>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=\"3\">\n\t\t\t\t\t\t\t<div style=\"height: 20px;padding: 10px;background: #FF0000;color:#FFF;font-weight: bold;\">La tarea es de prioridad <?=strtoupper($row[\"prioridad\"]);?></div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n<?\n\t\t\t\t}\n?>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=\"20%\" rowspan=\"<?=$cont?>\" align=\"center\" valign=\"middle\" style=\"height: 20px;padding: 5px;font-weight: bold;\">Responsable(s):</td>\n\t\t\t\t\t\t<td width=\"40%\" style=\"height: 20px;padding: 5px;\"><?=$NomResp[0]?></td>\n\t\t\t\t\t\t<td width=\"37%\" rowspan=\"<?=$cont?>\" align=\"center\" valign=\"middle\" style=\"text-align: center;\">\n\t\t\t\t\t\t\t<div style=\"margin: 0 auto 0 auto;height: 20px;width: 100px;background: #666;overflow: hidden;\"><div style=\"height: 20px;width: <?=$row[\"porcentaje\"]?>px;background:#89FF8F;\"></div></div> Avance <?=$row[\"porcentaje\"]?> %\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?\n\t\t\t\t\tfor($t=0; $t < $cont ; $t++){\n\t\t\t\t\t?>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style=\"height: 20px;padding: 5px;\"><?=$NomResp[($t+1)]?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t<?\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t\t<tr>\t\t\t\n\t\t\t\t\t\t<td style=\"height: 20px;padding: 5px;font-weight: bold;\">Fecha Inicio:</td>\n\t\t\t\t\t\t<td style=\"height: 20px;padding: 5px;\"> <?=$row[\"fecha_inicio\"]; ?></td>\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style=\"height: 20px;padding: 5px;font-weight: bold;\">Fecha Termino:</td>\n\t\t\t\t\t\t<td style=\"height: 20px;padding: 5px;\"> <?=$row[\"fecha_vencimiento\"]; ?></td>\t\t\t\t\t\t\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t</table>\t\t\t\t\t\t\t\t\n\t\t\t\t<span style=\"font-weight:bold; margin-left:5px;\">Descripción:</span> <br /><br /><span style=\"font-size:16px; margin-left:5px;\"><?=$row[\"descripcion\"]; ?></span><BR/><br />\n\t\t\t\t<span style=\"font-weight:bold; margin-left:5px;\">Observaciones:</span> <br /><br /><span style=\"font-size:16px; margin-left:5px;\"><?=$row[\"observaciones\"]; ?></span><BR/><br />\n\t\t\t\t<input type=\"hidden\" name=\"nombre\" id=\"nombre\" value=\"<?=$nombre;?>\" />\n<?\t\n\t\t\t\techo \"--------------------------------------------------------------------------<br>Seguimiento:\";\n\t\t\t\t$sqlDetalle=\"SELECT COUNT(id) AS total FROM bitacora where id_proyecto='$detalle'\";\n\t\t\t\t$resul=mysql_query($sqlDetalle,$this->conectarBd());\n\t\t\t\t$rowTotal=mysql_fetch_array($resul);\t\t\t\t\n\t\t\t\t//--------------\t\t\t\n\t\t\t\tif($rowTotal['total']==0){\n\t\t\t\t\techo \"<br> No hay seguimiento a esta Tarea<br>\";\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\t//echo $sqlSeguimiento=\"SELECT * FROM detalle_tarea WHERE id_tarea='$detalle'\";\n\t\t\t\t\t$sqlSeguimiento=\"SELECT bitacora.id AS id, id_proyecto, accion_realizada, responsable_bitacora, fecha_bitacora, hora_bitacora, nombre, apaterno FROM bitacora INNER JOIN userdbsistemas ON bitacora.responsable_bitacora = userdbsistemas.ID WHERE id_proyecto='\".$detalle.\"'\";\n\t\t\t\t\t$resultSeg=mysql_query($sqlSeguimiento,$this->conectarBd());\t\t\t\t\n\t\t\t\t\techo \"<br> Numero de seguimientos: \".$rowTotal[\"total\"].\"<br><br>\";\n\t\t\t\t\t$color=\"#F0F0F0\";\t\t\t\t\t\t\n\t\t\t\t\twhile($rowSeg=mysql_fetch_array($resultSeg)){\n\t\t\t\t\t\t//$imgProfileDetalle=\"../../../images/ui/img_profiles/\".$rowSeg['img_profile'];\n\t\t\t\t\t\t$imgProfileDetalle=\"../../img/other_profile.png\";\n\t\t\t\t\t\t$fechaB=explode(\"-\",$rowSeg['fecha_bitacora']);\t\t\t\t\t\t\n\t\t\t\t\t\t$diaSeg=date(\"w\",mktime(0,0,0,$fechaB[1],$fechaB[2],$fechaB[0]));\n\t\t\t\t\t\t$mesSeg=date(\"n\",mktime(0,0,0,$fechaB[1],$fechaB[2],$fechaB[0]));\n\t\t\t\t\t\t$dias= array(\"Domingo\",\"Lunes\",\"Martes\",\"Miercoles\",\"Jueves\",\"Viernes\",\"Sábado\");\n\t\t\t\t\t\t$meses= array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\");\t\t\t\t\t\t\n?>\t\t\t\t\t\n\t\t\t\t\t\t<div style=\" margin:4px 4px 10px 10px; overflow: hidden; border-bottom:1px solid #CCC; height:auto;\">\n\t\t\t\t\t\t\t<div style=\"float:left;\"><a href=\"#\"><img src=\"../../../images/ui/indice.jpeg\" title=\"Me Gusta\" width=\"15\" height=\"15\" /></a> </div>\n\t\t\t\t\t\t\t<div style=\"height:50px; width:50px; float:left; border:1px solid #F0F0F0; text-align:center;\"><img src=\"<?=$imgProfileDetalle;?>\" border=\"0\" height=\"49\" width=\"49\" /></div>\n \t\t\t\t\t\t\t<div style=\"background:<?=$color;?>;height:auto; width:80%;float:left; padding:3px;\"><strong>El <?=$dias[$diaSeg].\" \".$fechaB[2].\" de \".$meses[$mesSeg-1].\" de \".$fechaB[0].\" a las \".$rowSeg['hora_bitacora'].\" \".$rowSeg['nombre'].\" \";?>comento:</strong><br /> <?=$rowSeg['accion_realizada'];?></div>\t\t\t\t\t\t\n\t\t\t\t\t\t</div>\n<?\t\t\t\t\t\t\n\t\t\t\t\t\t($color==\"#F0F0F0\") ? $color=\"#FFF\" : $color=\"#F0F0F0\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\tmysql_free_result($resulta);\n?>\t\t\t</div>\n\t\t</div>\n<?\t \n\t}"
] | [
"0.71927136",
"0.6813789",
"0.65988606",
"0.6366804",
"0.6293173",
"0.62747055",
"0.6263895",
"0.6260774",
"0.6245398",
"0.62410855",
"0.62404764",
"0.6233562",
"0.6218355",
"0.62114066",
"0.6210505",
"0.62061733",
"0.6205202",
"0.61839664",
"0.6158986",
"0.6120672",
"0.61157763",
"0.6109352",
"0.6097751",
"0.6084582",
"0.6055544",
"0.60407865",
"0.6040577",
"0.6039461",
"0.6027702",
"0.60276264"
] | 0.69704556 | 1 |
if not logged in and trying to access a critical page, go to sign in page | public function checkLogIn() {
if (!$this->loggedIn()) {
header('Location: ' . config('constants.SIGNIN'));
die();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function UserIsSignedInOrRecirectToSignIn() {\n\n\t\tif(!$this -> uo -> isAuthenticated()) {\n $_SESSION['errorMessage'] = 'Du måste vara inloggad för att komma åt den sidan';\n CPageController::RedirectTo(WS_SITELINK . \"pages/login/PLogin.php\");\n\t\t}\n\t}",
"public function checkAuthentication(){\n\t\t\n\t\t// if user is not logged in\n\t\tif (!Session::userIsLoggedIn()) {\n\t\t\t// ... then treat user as \"not logged in\", destroy session, redirect to login page\n\t\t\tSession::destroy();\n\t\t\t// send the user to the login form page, but also add the current page's URI (the part after the base URL)\n\t\t\t// as a parameter argument, making it possible to send the user back to where he/she came from after a\n\t\t\t// successful login\n\t\n\t\t\t$this->redirect($this->config('app.baseurl') . '/login?redirect=' . urlencode($_SERVER['REQUEST_URI']));\n\t\t\t// in ambiente Slim, in alterantiva a $_SERVER['REQUEST_URI'] forse si potrebbe uare $this->request->getPath();\n\t\n\t\t\t// to prevent fetching views via cURL (which \"ignores\" the header-redirect above) we leave the application\n\t\t\t// the hard way, via exit(). @see https://github.com/panique/php-login/issues/453\n\t\t\t// this is not optimal and will be fixed in future releases\n\t\t\texit();\n\t\t}\n\t}",
"private function checkLogin()\n {\n if (isset($_SESSION['userName'])) {\n\n } else {\n edirect(base_url() . \"index.php/User/index\");\n }\n }",
"function loggedInCheck()\n{\n\t// ALLEEN TE GEBRUIKEN VOOR LOG IN REQUIRED PAGES\n\tif (!isset($_SESSION['user_id'])) {\n\t\tsession_start();\n\t}\n}",
"private function check_login()\n {\n if ($this->auth_required == TRUE AND Auth::instance()->logged_in($this->auth_role) == FALSE)\n {\n if (Auth::instance()->logged_in())\n {\n $this->redirect('pages/noaccess');\n }\n else\n {\n $this->redirect('login');\n }\n }\n }",
"public function doLogInPage() {\n if(!isset($_SESSION['userSession'])) {\n $this->view->show(\"login.php\");\n } else {\n header(\"Location: index.php?loggedstatus=true\");\n }\n }",
"private function checkLoggedIn(){\n session_start();\n if(!isset($_SESSION[\"email\"])){\n header(\"Location: \".LOGIN);\n \n }\n }",
"public function login() {\n\t\t$uri = new URI();\n\n\t\t// Redirect to invite page if not logged or signing in\n\t\tif (!in_array($uri->string(), array('invite', 'sign/in')) && strpos($uri->string(), 'sign/up') !== 0 && !Visitor::instance()->logged_in()) {\n\n\t\t\t// Stop execution if ajax, ie. expired session and trying to do ajax call\n\t\t\tif (request::is_ajax()) {\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\turl::redirect('invite');\n\t\t}\n\n\t}",
"public function requireLogin()\n {\n if(! Authenticate::getUser())\n {\n //echo \"got profile index<br/>\";\n Flash::addMessage('Please log in to access requested page');\n\n Authenticate::rememberRequestedPage();\n\n $this->redirect('/fyp/public/?Admin/Login/new');\n }\n }",
"private function check_if_logged_in()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n header( \"Location: \" . Utility::site_url() );\n exit;\n }\n }",
"public function authenticate(){\n\t\tif(isset($_SESSION['userLevel']) && $_SESSION['userLevel']=='normal'){\n\t\t\t;\n\t\t}\n\t\telse{\n\t\t\theader('Location:index.php');\n\t\t}\n\n\t}",
"public function requireLogin(): void {\n\t\tif (! Auth::getUser()) {\n\t\t\tFlash::addMessage('Please log in to access that page', Flash::INFO);\n\t\t\tAuth::rememberRequestedPage();\n\n\t\t\tUtilities::redirect('/login', 303);\n\t\t}\n\t}",
"private function pre_action()\n\t{\n\t\tif($this->users->current_user('is_signed_in'))\n\t\t{\n\t\t\tredirect($this->users->current_user('home_url'));\n\t\t}\n\t}",
"public static function require_login () {\r\n\t\t\tif (!Config::is_user_logged())\r\n\t\t\t\t$app->force_redirect();\r\n\t\t}",
"public static function require_login()\n\t{\n\t\tif(!self::logged_in())\n\t\t{\n\t\t\tSession::instance()->set('redirect', url::current(true));\n\t\t\turl::redirect('login');\n\t\t}\n\t}",
"public function authDoView(){\n if(!$this->authUser()){\n echo '{\"status\":-1,\"result\":\"/user/login?prePage='.$_SERVER['HTTP_REFERER'].'\"}';\n exit();\n }\n }",
"public function requireLogin()\n {\n if (!$this->user = Auth::getUser()) {\n\n Auth::rememberRequestedPage();\n Flash::addMessage('Please login to access that page.', Flash::ERROR);\n\n $this->redirect('/');\n }\n }",
"static private function enforceLogin(){\r\n\r\n\t\tif (self::$page !== 'login' && self::$page !== 'install' && self::$page !== '404' && !Session::isLoggedIn()){\r\n\t\t\theader('Location: index.php?p=login');\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"public function signin(){\t\t\n\n\t\tif($this->account_model->isLoggedIn()){\n\t\t\t$this->dashboard();\n\t\t}\n\t\telse{\n\t\t\t$this->layouts->setTitle('Sign-In');\n\t\t\t$this->__loadJsAndCSS();\t\t\n\t\t\t$this->layouts->view('account/signin','','signin');\n\t\t}\n\t}",
"protected function login_required() \n {\n $user = UserModel::singleton();\n $class_view = get_final_class_name('View');\n $view = $class_view::singleton();\n if (!$user->is_logged()) {\n $view->set_msg(\"You must be logged in to access this section.\", false);\n UserController::loginAction();\n exit();\n }\n }",
"protected function checkIfLoggedIn(){\n try {\n $this->helper->startSession();\n $url = $_SERVER['REQUEST_URI'];\n \n if (\n strpos($url, \"login.php\") || \n strpos($url, \"reset-password.php\") || \n strpos($url, \"activate-account.php\") || \n strpos($url, \"register.php\") || \n !strpos($url, \"cms\")\n ){\n return;\n }\n \n if(!isset($_SESSION['loggedInUser'])){\n $this->helper->redirect('login.php');\n }\n } catch (Exception $e){\n // If error occured, show it in the website\n $this->addToErrors($e->getMessage());\n }\n }",
"protected function _not_logged_in () {\n\t\t\t$this->session->set( 'return-to', Request::$current->url() );\n\t\t\tthrow new HTTP_Exception_401();\n\t\t}",
"function agc_login_steps_redirect_loggedin()\n{\n\tif(is_page_template('template-login-steps.php'))\n\t{\n\t\tif(!is_user_logged_in())\n\t\t{\n\t\t\twp_redirect(bp_get_signup_page());\n\t\t\texit;\n\t\t}\n\t\t//Prevent user from going back to login steps after completion once.\n\t\telseif(is_user_logged_in() && (agc_login_steps_getset_step() === 'completed'))\n\t\t{\n\t\t\twp_redirect(get_bloginfo('url').\"/millennium-community/\");\n\t\t\texit;\n\t\t}\n\t}\n}",
"public function checkIfLoggedIn(){\r\n\t\t\tif(isset($_SESSION['logged_in_user'])){\r\n\t\t\t\t$uri = $this->remove_whitespace($_SESSION['logged_in_user']);\r\n\t\t\t\t$url = __LOCATION__ .'/'. $uri;\r\n\t\t\t\theader('Location: ' . $url);\r\n\t\t\t}\r\n\t\t}",
"protected function require_login()\n {\n if(!$this->is_logged_in())\n {\n $this->system_message_model->set_message('You need to be logged in to do that', MESSAGE_WARNING);\n redirect('home','location');\n }\n }",
"function ensure_logged_in() {\n if(!isset($_SESSION['Logged In']) || !$_SESSION['Logged In'])\n header('Location: /index.php');\n }",
"public static function forbid_login () {\r\n\t\t\tif (Config::is_user_logged())\r\n\t\t\t\t$app->force_redirect();\r\n\t\t}",
"private function require_login()\n\t{\n\t\tglobal $User;\n\t\t\n\t\tif ( !$User->logged_in() )\n\t\t{\n\t\t\t// Save this page's URL variables.\n\t\t\t$_SESSION['post-login'] = $_SERVER['QUERY_STRING'];\n\t\t\t\n\t\t\t// Redirect to login page.\n\t\t\theader('Location: /?p=login');\n\t\t\t\n\t\t\t// Halt execution of the current page and script.\n\t\t\texit();\n\t\t}\n\t}",
"public function check_login()\n\t{\n\t\tif(!UID)\n\t\t\tredirect(\"login\");\n\t}",
"function need_login() {\n global $xp;\n\tif (!$xp->user->status) {\n\t\tredirect('?act=signin');\n\t}\n}"
] | [
"0.79287213",
"0.7343669",
"0.72709405",
"0.72610843",
"0.72593004",
"0.72330153",
"0.72125405",
"0.7190947",
"0.7180314",
"0.7166431",
"0.71405864",
"0.7134924",
"0.7130988",
"0.71082246",
"0.7088518",
"0.7066209",
"0.70612526",
"0.7055866",
"0.7008306",
"0.69976956",
"0.6986817",
"0.6983031",
"0.69817036",
"0.6969585",
"0.6948375",
"0.6935237",
"0.6931081",
"0.6929311",
"0.6924382",
"0.6922417"
] | 0.7685009 | 1 |
Logs pageview to analytics | private function logAnalytics($pageName) {
$analytics = new Analytics();
$analytics->recordView($pageName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logs_visitor_report() {\n\n\t\t$this->session_lib->check_permission_with_redirect_page($this->accessName);\n\n\t\t$this->log_activity_lib->log($this->accessName, $this->activityName);\n\n\t\t$addAttribPage = array(\n\t\t\t\t\t\t\t\t'subtitleMenu' => '<i class=\"fa fa-list-alt\"></i> Report',\n\t\t\t\t\t\t\t\t'sublinkMenu' => '<li class=\"active\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-list-alt\"></i> Report\n\t\t\t\t\t\t\t\t\t\t\t\t</li>',\n\t\t\t\t\t\t\t\t'filterUser' => $this->filter_user(),\n\t\t\t\t\t\t\t\t'filterAccess' => $this->filter_access()\n\t\t\t\t\t\t\t);\n\n\t\t$viewData = array_merge($addAttribPage, $this->attribPage, $this->attribThisPage);\n\n\t\t$this->template_lib->webadmin_default_template('webadmin/user_mg/logs/visitor', $viewData);\n\n\t}",
"public function pageview()\n {\n\t// If it is bot, refuse it\n\t$agent = new Agent();\n\tif (!$agent->device() or $agent->device() == 'Bot') return;\n\n // Only interact once per experiment. \n if ($this->session->get('pageview/' . $this->prefix())) return; \n $experiment = Experiment::firstOrNew(['name' => $this->experiment()]);\n $experiment->visitors++; \n $experiment->save();\n\n $goal = Goal::firstOrCreate(['name' => 'all', 'experiment' => $this->experiment()]);\n $deviceInfo = $this->getDeviceInfo($goal);\n Goal::where('name', 'all')->where('experiment', $this->experiment())\n ->update(array_merge(['count' => ($goal->count + 1)], $deviceInfo));\n \n $this->logAll('all'); \n\n // Mark current experiment as interacted.\n $this->session->set('pageview/' . $this->prefix(), 1);\n }",
"public static function logPageAccess($page) {\n global $LAS_USER;\n\n if ( isset($LAS_USER) ) {\n $partner = Log::LOG_PARTNER_LOG;\n $msg = self::_getUserInfo();\n $msg->time = time();\n Log::_log($partner, $page, json_encode($msg));\n }\n }",
"private function set_sent_pageview() {\n\t\t$this->js[] = \"ga('send', 'pageview');\";\n\t}",
"public function analyticsTrackPage()\n {\n $output = '';\n $analytics = (array)Configure::read('Services.analytics');\n\n foreach ($analytics as $provider => $key) {\n if ($key) {\n $output .= $this->_View->element('Analytics/' . $provider . '/trackPage', compact('key'));\n }\n }\n\n return $output;\n }",
"private function logData(): void\n {\n //get the referer to my home page(if necessary)\n $serverName = $_SERVER['SERVER_ADDR'] ?? $_SERVER['SERVER_NAME'];\n\n if (isset($_SESSION['visitorUrl'])) {\n $referer = $_SESSION['visitorUrl'];\n } else {\n $referer = '';\n }\n\n $str = \"\\\\r\\\n \" . \"Remote addr\\\t\" . $this->ip . \"\\\\r\\ \" .\n \" Server addr\\\t \" . $serverName . \"\\\\r\\ \" .\n \" User agent\\\t\" . $_SERVER['HTTP_USER_AGENT'] . \"\\\\r\\ \" .\n \" Referer:\\\t \" . $referer . \"\\\\r\\ \" .\n date('j M Y g:i a') . \"\\\\r\\ \";\n\n //open the logfile\n $fw = fopen($this->logfile, 'a+');\n //write the log data for this visit to file\n fwrite($fw, $str);\n fclose($fw);\n }",
"function logs_report() {\n\n\t\t$this->session_lib->check_permission_with_redirect_page($this->accessName);\n\n\t\t$this->log_activity_lib->log($this->accessName, $this->activityName);\n\n\t\t$addAttribPage = array(\n\t\t\t\t\t\t\t\t'subtitleMenu' => '<i class=\"fa fa-list-alt\"></i> Report',\n\t\t\t\t\t\t\t\t'sublinkMenu' => '<li class=\"active\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-list-alt\"></i> Report\n\t\t\t\t\t\t\t\t\t\t\t\t</li>',\n\t\t\t\t\t\t\t\t'filterUser' => $this->filter_user(),\n\t\t\t\t\t\t\t\t'filterAccess' => $this->filter_access()\n\t\t\t\t\t\t\t);\n\n\t\t$viewData = array_merge($addAttribPage, $this->attribPage, $this->attribThisPage);\n\n\t\t$this->template_lib->webadmin_default_template('webadmin/user_mg/logs/index', $viewData);\n\n\t}",
"function log_start($page_name, $udb, $url, $http_get, $http_post)\n{\n \n}",
"public function activity_log() {\n\t\t$this->load->model('user/users_model','users');\n\t\tshow(array(\n\t\t\t'page' => 'activity_log',\n\t\t\t'get' =>$this->users->users_details(),\n\t\t\t'script' => 'user/login',\n\t\t\t'sub_title' => 'Activity Log',\n\t\t\t'view' => 'user/activity_log'\n\t\t));\n\t}",
"function addPageView($event=\"PAGE_VIEW\",$userid=USERID) {\r\n\t\r\n\tglobal $noCountPages, $query_array, $custom_report_sql, $Proj;\r\n\t\r\n\t// If this is the REDCap cron job, then skip this\r\n\tif (defined('CRON')) return;\r\n\t\r\n\t// Set userid as blank if USERID is not defined\r\n\tif (!defined(\"USERID\") && $userid == \"USERID\") $userid = \"\";\r\n\t\r\n\t// If current page view is to be logged (i.e. if not set as noCourntPage and is not a survey passthru page)\r\n\tif (!in_array(PAGE, $noCountPages) && !(PAGE == 'surveys/index.php' && isset($_GET['__passthru']))) \r\n\t{\r\n\t\t// Obtain browser info\r\n\t\t$browser = new Browser();\r\n\t\t$browser_name = strtolower($browser->getBrowser());\r\n\t\t$browser_version = $browser->getVersion();\r\n\t\t// Do not include more than one decimal point in version\r\n\t\tif (substr_count($browser_version, \".\") > 1) {\r\n\t\t\t$browser_version_array = explode(\".\", $browser_version);\r\n\t\t\t$browser_version = $browser_version_array[0] . \".\" . $browser_version_array[1];\r\n\t\t}\r\n\t\t\r\n\t\t// Obtain other needed values\r\n\t\t$ip \t \t= getIpAddress();\r\n\t\t$page \t \t= (defined(\"PAGE\") ? PAGE : \"\");\r\n\t\t$event\t \t= strtoupper($event);\r\n\t\t$project_id = defined(\"PROJECT_ID\") ? PROJECT_ID : \"NULL\";\r\n\t\t$full_url\t= curPageURL();\r\n\t\t$session_id = (!session_id() ? \"\" : substr(session_id(), 0, 32));\r\n\t\t\r\n\t\t// Defaults \r\n\t\t$event_id \t= \"NULL\";\r\n\t\t$record\t\t= \"\";\r\n\t\t$form_name \t= \"\";\r\n\t\t$miscellaneous = \"\";\r\n\t\t\r\n\t\t// Special logging for certain pages\r\n\t\tswitch (PAGE) \r\n\t\t{\r\n\t\t\t// Data Quality rule execution\r\n\t\t\tcase \"DataQuality/execute_ajax.php\":\r\n\t\t\t\t$miscellaneous = \"// rule_ids = '{$_POST['rule_ids']}'\";\r\n\t\t\t\tbreak;\r\n\t\t\t// External Links clickthru page\r\n\t\t\tcase \"ExternalLinks/clickthru_logging_ajax.php\":\r\n\t\t\t\t$miscellaneous = \"// url = \" . $_POST['url'];\r\n\t\t\t\tbreak;\r\n\t\t\t// Survey page\r\n\t\t\tcase \"surveys/index.php\":\r\n\t\t\t\t// For SURVEYS ONLY, save IP address as hashed value in cache table to prevent automated attacks\r\n\t\t\t\tstoreHashedIp($ip);\r\n\t\t\t\t// Set username and erase ip to maintain anonymity survey respondents\r\n\t\t\t\t$userid = \"[survey respondent]\";\r\n\t\t\t\t$ip = \"\";\r\n\t\t\t\t// Capture the response_id if we have it\r\n\t\t\t\tif (isset($_POST['__response_hash__']) && !empty($_POST['__response_hash__'])) {\r\n\t\t\t\t\tglobal $participant_id;\r\n\t\t\t\t\t$miscellaneous = \"// response_id = \" . decryptResponseHash($_POST['__response_hash__'], $participant_id);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// API\r\n\t\t\tcase \"api/index.php\":\r\n\t\t\t\t// If downloading file, log it\r\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\t\t\t\t\r\n\t\t\t\t\t// Set values needed for logging\r\n\t\t\t\t\tif (isset($_POST['token']) && !empty($_POST['token']))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$q = db_query(\"select project_id, username from redcap_user_rights where api_token = '\" . $_POST['token'] . \"'\");\r\n\t\t\t\t\t\t$userid = db_result($q, 0, \"username\");\r\n\t\t\t\t\t\t$project_id = db_result($q, 0, \"project_id\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$post = $_POST;\r\n\t\t\t\t\t// Remove data from $_POST for logging\r\n\t\t\t\t\tif (isset($post['data'])) $post['data'] = '[not displayed]';\r\n\t\t\t\t\t$miscellaneous = \"// API Request: \";\r\n\t\t\t\t\tforeach ($post as $key=>$value) {\r\n\t\t\t\t\t\t$miscellaneous .= \"$key=>\" . ((is_array($value)) ? implode(\", \", $value) : $value) . \"; \";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$miscellaneous = substr($miscellaneous, 0, -2);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Data history\r\n\t\t\tcase \"DataEntry/data_history_popup.php\":\r\n\t\t\t\tif (isset($_POST['event_id'])) \r\n\t\t\t\t{\r\n\t\t\t\t\t$form_name = $Proj->metadata[$_POST['field_name']]['form_name'];\r\n\t\t\t\t\t$event_id = $_POST['event_id'];\r\n\t\t\t\t\t$record = $_POST['record'];\r\n\t\t\t\t\t$miscellaneous = \"field_name = '\" . $_POST['field_name'] . \"'\";\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Send it download\r\n\t\t\tcase \"SendIt/download.php\":\r\n\t\t\t\t// If downloading file, log it\r\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n\t\t\t\t\t$miscellaneous = \"// Download file (Send-It)\";\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Send it upload\r\n\t\t\tcase \"SendIt/upload.php\":\r\n\t\t\t\t// Get project_id\r\n\t\t\t\t$fileLocation = (isset($_GET['loc']) ? $_GET['loc'] : 1);\r\n\t\t\t\tif ($fileLocation != 1) {\r\n\t\t\t\t\tif ($fileLocation == 2) //file repository\r\n\t\t\t\t\t\t$query = \"SELECT project_id FROM redcap_docs WHERE docs_id = \" . $_GET['id'];\r\n\t\t\t\t\telse if ($fileLocation == 3) //data entry form\r\n\t\t\t\t\t\t$query = \"SELECT project_id FROM redcap_edocs_metadata WHERE doc_id = \" . $_GET['id'];\r\n\t\t\t\t\t$project_id = db_result(db_query($query), 0);\r\n\t\t\t\t}\r\n\t\t\t\t// If uploading file, log it\r\n\t\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\r\n\t\t\t\t\t$miscellaneous = \"// Upload file (Send-It)\";\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Data entry page\r\n\t\t\tcase \"DataEntry/index.php\":\r\n\t\t\t\tif (isset($_GET['page'])) {\r\n\t\t\t\t\t$form_name = $_GET['page'];\r\n\t\t\t\t\t$event_id = isset($_GET['event_id']) ? $_GET['event_id'] : getSingleEvent(PROJECT_ID);\r\n\t\t\t\t\tif (isset($_GET['id'])) $record = $_GET['id'];\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Page used for reseting user's session\r\n\t\t\tcase \"ProjectGeneral/login_reset.php\":\r\n\t\t\t\tif (isset($_GET['page'])) {\r\n\t\t\t\t\t$form_name = $_GET['page'];\r\n\t\t\t\t\t$event_id = isset($_GET['event_id']) ? $_GET['event_id'] : getSingleEvent(PROJECT_ID);\r\n\t\t\t\t\tif (isset($_GET['id'])) $record = $_GET['id'];\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// PDF form export\r\n\t\t\tcase \"PDF/index.php\":\r\n\t\t\t\tif (isset($_GET['page'])) $form_name = $_GET['page'];\r\n\t\t\t\t$event_id = isset($_GET['event_id']) ? $_GET['event_id'] : getSingleEvent(PROJECT_ID);\r\n\t\t\t\tif (isset($_GET['id'])) $record = $_GET['id'];\r\n\t\t\t\tbreak;\r\n\t\t\t// Longitudinal grid\r\n\t\t\tcase \"DataEntry/grid.php\":\r\n\t\t\t\tif (isset($_GET['id'])) $record = $_GET['id'];\r\n\t\t\t\tbreak;\r\n\t\t\t// Calendar\r\n\t\t\tcase \"Calendar/index.php\":\r\n\t\t\t\t// Obtain mm, dd, yyyy being viewed\r\n\t\t\t\tif (!isset($_GET['year'])) {\r\n\t\t\t\t\t$_GET['year'] = date(\"Y\");\r\n\t\t\t\t}\r\n\t\t\t\tif (!isset($_GET['month'])) {\r\n\t\t\t\t\t$_GET['month'] = date(\"n\")+1;\r\n\t\t\t\t}\r\n\t\t\t\t$month = $_GET['month'] - 1;\r\n\t\t\t\t$year = $_GET['year'];\r\n\t\t\t\tif (isset($_GET['day']) && $_GET['day'] != \"\") {\r\n\t\t\t\t\t$day = $_GET['day'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$day = $_GET['day'] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$days_in_month = date(\"t\", mktime(0,0,0,$month,1,$year));\r\n\t\t\t\t// Set values\r\n\t\t\t\t$view = (!isset($_GET['view']) || $_GET['view'] == \"\") ? \"month\" : $_GET['view'];\r\n\t\t\t\t$miscellaneous = \"view: $view\\ndates viewed: \";\r\n\t\t\t\tswitch ($view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\t\t$miscellaneous .= \"$month/$day/$year\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\t\t$miscellaneous .= \"week of $month/$day/$year\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$miscellaneous .= \"$month/1/$year - $month/$days_in_month/$year\";\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t// Edoc download\r\n\t\t\tcase \"DataEntry/file_download.php\":\t\t\t\t\r\n\t\t\t\t$record = $_GET['record'];\r\n\t\t\t\t$event_id = $_GET['event_id'];\r\n\t\t\t\t$form_name = $_GET['page'];\r\n\t\t\t\tbreak;\r\n\t\t\t// Calendar pop-up\r\n\t\t\tcase \"Calendar/calendar_popup.php\":\r\n\t\t\t\t// Check if has record or event\r\n\t\t\t\t$q = db_query(\"select record, event_id from redcap_events_calendar where cal_id = {$_GET['cal_id']}\");\r\n\t\t\t\t$record = db_result($q, 0, \"record\");\r\n\t\t\t\t$event_id = checkNull(db_result($q, 0, \"event_id\"));\r\n\t\t\t\tbreak;\r\n\t\t\t// Scheduling module\r\n\t\t\tcase \"Calendar/scheduling.php\":\r\n\t\t\t\tif (isset($_GET['record'])) {\r\n\t\t\t\t\t$record = $_GET['record'];\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t// Graphical Data View page\r\n\t\t\tcase \"Graphical/index.php\":\r\n\t\t\t\tif (isset($_GET['page'])) { \r\n\t\t\t\t\t$form_name = $_GET['page'];\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t// Graphical Data View highest/lowest/missing value\r\n\t\t\tcase \"Graphical/highlowmiss.php\":\r\n\t\t\t\t$form_name \t= $_GET['form'];\r\n\t\t\t\t$miscellaneous = \"field_name: '{$_GET['field']}'\\n\"\r\n\t\t\t\t\t\t\t . \"action: '{$_GET['svc']}'\\n\"\r\n\t\t\t\t\t\t\t . \"group_id: \" . (($_GET['group_id'] == \"undefined\") ? \"\" : $_GET['group_id']);\r\n\t\t\t\tbreak;\r\n\t\t\t// Viewing a report\r\n\t\t\tcase \"Reports/report.php\":\r\n\t\t\tcase \"Reports/report_export.php\":\r\n\t\t\t\t// Report Builder reports\r\n\t\t\t\tif (isset($_GET['query_id'])) {\r\n\t\t\t\t\t$miscellaneous = \"// Report array for \\\"\" . $query_array[$_GET['query_id']]['__TITLE__'] . \"\\\":\";\r\n\t\t\t\t\tforeach ($query_array[$_GET['query_id']] as $this_field=>$this_where) {\r\n\t\t\t\t\t\t$miscellaneous .= \"\\n\\$query_array[{$_GET['query_id']}]['$this_field'] = '$this_where';\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Legacy reports\r\n\t\t\t\tif (isset($_GET['id'])) {\r\n\t\t\t\t\t$miscellaneous = \"// Report array for \\\"\" . $custom_report_menu[$_GET['query_id']] . \"\\\":\";\r\n\t\t\t\t\tforeach ($custom_report_sql[$_GET['id']] as $this_field=>$this_where) {\r\n\t\t\t\t\t\t$miscellaneous .= \"\\n\\$custom_report_sql[{$_GET['id']}]['$this_field'] = '$this_where';\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Data comparison tool\r\n\t\t\tcase \"DataComparisonTool/index.php\":\r\n\t\t\t\tif (isset($_POST['record1'])) {\r\n\t\t\t\t\tlist ($record1, $event_id1) = explode(\"[__EVTID__]\", $_POST['record1']);\r\n\t\t\t\t\tif (isset($_POST['record2'])) {\r\n\t\t\t\t\t\tlist ($record2, $event_id2) = explode(\"[__EVTID__]\", $_POST['record2']);\r\n\t\t\t\t\t\t$record = \"$record1 (event_id: $event_id1)\\n$record2 (event_id: $event_id2)\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$record = \"$record1 (event_id: $event_id1)\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// File repository and data export docs\r\n\t\t\tcase \"FileRepository/file_download.php\":\r\n\t\t\t\tif (isset($_GET['id'])) {\r\n\t\t\t\t\t$miscellaneous = \"// Download file from redcap_docs (docs_id = {$_GET['id']})\";\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t// Logging page\r\n\t\t\tcase \"Logging/index.php\":\r\n\t\t\t\tif (isset($_GET['record']) && $_GET['record'] != '') {\r\n\t\t\t\t\t$record = $_GET['record'];\r\n\t\t\t\t}\r\n\t\t\t\tif (isset($_GET['usr']) && $_GET['usr'] != '') {\r\n\t\t\t\t\t$miscellaneous = \"// Filter by user name ('{$_GET['usr']}')\";\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Do logging\r\n\t\t$sql = \"insert into redcap_log_view (ts, user, event, ip, browser_name, browser_version, full_url, page, project_id, event_id, \r\n\t\t\t\trecord, form_name, miscellaneous, session_id) values ('\".NOW.\"', '\" . prep($userid) . \"', '$event', \" . checkNull($ip) . \", \r\n\t\t\t\t'\" . prep($browser_name) . \"', '\" . prep($browser_version) . \"', \r\n\t\t\t\t'\" . prep($full_url) . \"', '$page', $project_id, $event_id, \" . checkNull($record) . \", \r\n\t\t\t\t\" . checkNull($form_name) . \", \" . checkNull($miscellaneous) . \", \" . checkNull($session_id) . \")\";\r\n\t\tdb_query($sql);\r\n\t\t\r\n\t\treturn;\r\n\t}\r\n}",
"public function logRequest()\n {\n $requestMethod = $this->getRequestMethod();\n \n if (! in_array($requestMethod, $this->pageRequestMethods)) {\n return;\n }\n \n $data = [\n 'request_uri' => $this->getRequestUri(),\n 'ip_address' => $this->getIpAddress(),\n 'timestamp' => time(),\n 'request_method' => $requestMethod,\n 'blocked' => false,\n 'request_count' => 1\n ];\n \n $this->storage->store($data);\n }",
"public function logger()\n {\n\n Log::$disabled = true;\n\n $this->renderPageFile('page.logger');\n }",
"public function analytics_tracking_code() {\r\n\t\t$analytics_enabled = WPMUDEV_Dashboard::$site->get_option( 'analytics_enabled' );\r\n\t\t$analytics_site_id = WPMUDEV_Dashboard::$site->get_option( 'analytics_site_id' );\r\n\t\t$analytics_tracker = WPMUDEV_Dashboard::$site->get_option( 'analytics_tracker' );\r\n\t\tif ( is_wpmudev_member() && $analytics_enabled && $analytics_site_id && $analytics_tracker ) {\r\n\t\t\t?>\r\n\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\tvar _paq = _paq || [];\r\n\t\t\t\t<?php\r\n\t\t\t\tif ( is_multisite() ) {\r\n\t\t\t\t\t// This lets us use page titles view to filter basic results for a subsite based on domain (works with domain mapping too)\r\n\t\t\t\t\techo '_paq.push([\"setDocumentTitle\", \"' . get_current_blog_id() . '/\" + document.title]);' . PHP_EOL;\r\n\t\t\t\t\tif ( is_subdomain_install() ) { // makes sure visitors are tracked across multisite (except domain mapped)\r\n\t\t\t\t\t\techo '\t_paq.push([\"setCookieDomain\", \"*.' . parse_url( network_home_url(), PHP_URL_HOST ) . '\"]);' . PHP_EOL;\r\n\t\t\t\t\t\techo '\t_paq.push([\"setDomains\", \"*.' . parse_url( network_home_url(), PHP_URL_HOST ) . '\"]);' . PHP_EOL;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// collect author stats on single post views, excluding pages.\r\n\t\t\t\tif ( is_single() ) {\r\n\t\t\t\t\techo '\t_paq.push([\\'setCustomDimension\\', 1, \\'{\"ID\":' . get_the_author_meta( 'ID' ) . ',\"name\":\"' . esc_js( get_the_author_meta( 'display_name' ) ) . '\",\"avatar\":\"'\r\n\t\t\t\t\t\t . md5( get_the_author_meta( 'user_email' ) ) . '\"}\\']);' . PHP_EOL;\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t_paq.push(['trackPageView']);\r\n\t\t\t\t<?php\r\n\t\t\t\t/*\r\n\t\t\t\tif ( ! is_multisite() ) { // link tracking would be too heavy on multisite, and have problems with domain mapping\r\n\t\t\t\t\techo \"_paq.push(['enableLinkTracking']);\" . PHP_EOL;\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\t\t?>\r\n\t\t\t\t(function () {\r\n\t\t\t\t\tvar u = \"<?php echo trailingslashit( $analytics_tracker ); ?>\";\r\n\t\t\t\t\t_paq.push(['setTrackerUrl', u + 'track/']);\r\n\t\t\t\t\t_paq.push(['setSiteId', '<?php echo intval( $analytics_site_id ); ?>']);\r\n\t\t\t\t\tvar d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];\r\n\t\t\t\t\tg.type = 'text/javascript';\r\n\t\t\t\t\tg.async = true;\r\n\t\t\t\t\tg.defer = true;\r\n\t\t\t\t\tg.src = 'https://stats.wpmucdn.com/analytics.js';\r\n\t\t\t\t\ts.parentNode.insertBefore(g, s);\r\n\t\t\t\t})();\r\n\t\t\t</script>\r\n\t\t\t<?php\r\n\t\t}\r\n\t}",
"public function index()\n{\nlogSystem('/sy_article',0,\"Open page sy_article\",'index',request()->ip());\nreturn view(\"sy_article.sy_article_frm\");\n}",
"public function startQueryCapture() {\n Database::startLog('views');\n }",
"function logpage() {\n\t$logfile = \"/somewhere/logs.txt\";\n\t$logdata = date(\"Y/m/d\") . \" \" . date(\"h:i:sa\") . \" | \" . $_SERVER[\"REMOTE_ADDR\"] . \" | \";\n\t$logdata = $logdata . \"http://\" . $_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"] . \" | \";\n\t$logdata = $logdata . $_SERVER[\"HTTP_USER_AGENT\"] . \"\\r\\n\\r\\n\";\n\tfile_put_contents($logfile, $logdata, FILE_APPEND);\n}",
"public function log(){\n\t\t$this->model('WorkoutModel');\n\t\t$selects = $this->model->getWorkouts();\n\t\t$logHistory = $this->model->getLog();\n\t\t$this->view('workout'.'/'.'log.php',[$selects,$logHistory]);\n\t\t$this->view->render();\n\t}",
"function logView(\\LK\\Kampagne\\Kampagne $kampagne){\n $nid = $kampagne ->getNid();\n $uid = $this->account->getUid();\n\n // Track unique node view per day\n $time = strtotime(date('Y-m-d 00:00:01'));\n $dbq = db_query('SELECT count(*) as count FROM lk_lastviewed WHERE uid=:uid AND nid=:nid AND lastviewed_time>:last', [':uid' => $uid, ':nid' => $nid, ':last' => $time]);\n $res = $dbq -> fetchObject();\n \n if($res -> count == 0) {\n \\LK\\Stats::logUserAccessedKampagnen($uid);\n }\n \n db_query(\"DELETE FROM lk_lastviewed WHERE uid='\". $uid .\"' AND nid='\". $nid .\"'\");\n db_query(\"INSERT INTO lk_lastviewed SET uid='\". $uid .\"', nid='\". $nid .\"', lastviewed_time='\". time() .\"'\");\n $this->setAction('view-kampagne', $nid);\n\n // log stats\n\n\n $this->performedAction();\n }",
"public function index() \n\t{\n\t\t$this->set('logData', $this->getLogData());\n\t}",
"function request_ga()\r\n\t{\r\n\t\tif(count($_POST) > 0)\r\n\t\t{\r\n\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t$data['dtNow'] = date(\"d/m/Y\",now());\r\n\t\t\t$this->getView($this->uri->segment(1),$this->uri->segment(2),$data);\r\n\t\t}\r\n\t}",
"function wpsc_display_purchase_logs_page() {\n\tdo_action( 'wpsc_display_purchase_logs_page' );\n}",
"public function logged();",
"private function request_analytics(){\n\t\t$cookie_is_valid = true;\n\t\tif(isset($_COOKIE['magic_id'])){\n\t\t\tif(VisitorSearcher::Factory()->search_by_id(base_convert($_COOKIE['magic_id'], 36,10))->count() == 0){\n\t\t\t\t$cookie_is_valid = false;\n\t\t\t}\n\t\t}\n\t\t#echo \"Cookie is \" . ($cookie_is_valid?'valid':'not valid');\n\t\t\n\t\t// Give the user a magic_id if they've not got one.\n\t\tif(!isset($_COOKIE['magic_id']) || $cookie_is_valid === false){\n\t\t\t//Look for Visitors from this location before...\n\t\t\t$oVisitor = VisitorSearcher::Factory()->search_by_ip($_SERVER['REMOTE_ADDR'])->execute_one();\n\t\t\tif($oVisitor === false ){\n\t\t\t\t$oVisitor = Visitor::Factory()\n\t\t\t\t\t->set_ip($_SERVER['REMOTE_ADDR'])\n\t\t\t\t\t->save();\n\t\t\t}\n\t\t\t$oVisitor = Visitor::Cast($oVisitor);\n\t\t\t$time_to_expire = strtotime(\"now + 4 weeks\");\n\t\t\tsetcookie(\"magic_id\", $oVisitor->get_id36(), $time_to_expire,\"/\");\n\t\t}\n\n\t\t// Load their Visitor record...\n\t\tif($oVisitor === null){\n\t\t\t$oVisitor = VisitorSearcher::Factory()\n\t\t\t\t->search_by_id(base_convert($_COOKIE['magic_id'], 36,10))\n\t\t\t\t->execute_one();\n\t\t}\n\t\t\n\t\t$oVisitor = Visitor::Cast($oVisitor);\n\t\tif(isset($_SERVER['REDIRECT_URL'])){\n\t\t\t$path = $_SERVER['REDIRECT_URL'];\n\t\t}elseif(isset($_SERVER['REQUEST_URI'])){\n\t\t\t$path = $_SERVER['REQUEST_URI'];\n\t\t}else{\n\t\t\t$path = \"unknown_path\";\n\t\t}\n\t\t$oThisView = View::Factory()\n\t\t\t->set_visitor($oVisitor->get_id())\n\t\t\t->set_path($path)\n\t\t\t->set_accesstime(time())\n\t\t\t->save();\n\t}",
"function logs(){\n\n\t\t}",
"abstract protected function logRequestUrl();",
"function output_analytics() {\n\t\t\tglobal $km_key;\n\n\t\t\t// As long as the API key is set, output the analytics. Also add code to catch if the user is viewing the homepage.\n\t\t\tif( $km_key != '' ) {\n\t\t\t?><script type=\"text/javascript\">\n\t\t\t var _kmq = _kmq || [];\n\t\t\t var _kmk = _kmk || '<?php echo $km_key; ?>';\n\t\t\t function _kms(u){\n\t\t\t setTimeout(function(){\n\t\t\t var s = document.createElement('script'); var f = document.getElementsByTagName('script')[0]; s.type = 'text/javascript'; s.async = true;\n\t\t\t s.src = u; f.parentNode.insertBefore(s, f);\n\t\t\t }, 1);\n\t\t\t }\n\t\t\t _kms('//i.kissmetrics.com/i.js');_kms('//doug1izaerwt3.cloudfront.net/' + _kmk + '.1.js');\n\t\t\t <?php\n\t\t\t\t// Identify authenticated users\n\t\t\t\tif( is_user_logged_in() ) {\n\t\t\t\t\tglobal $current_user;\n\t\t\t\t\tget_currentuserinfo();\n\t\t\t\t\t?>_kmq.push(['identify', '<?php echo $current_user->user_email ?>']);\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t// Track social button interactions (tweet, like/unlike, FB connect)\n\t\t\t\tif( get_option( 'cc_kissmetrics_track_social' ) ) {\n\t\t\t\t\t?>_kmq.push(function() {\n\t\t\t\t\t\tif(window.twttr) {\n\t\t\t\t\t\t window.twttr.events.bind('tweet', function (event) {\n\t\t\t\t\t\t var url = KM.uprts(decodeURIComponent(event.target.src).replace('#', '?')).params.url;\n\t\t\t\t\t\t _kmq.push(['record', 'Tweet', { 'Shared URL': url }]);\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t window.twttr.events.bind('follow', function (event) {\n\t\t\t\t\t\t \t_kmq.push(['record', 'Twitter Follow', { 'Username': event.data.screen_name }]);\n\t\t\t\t\t\t });\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(window.FB) {\n\t\t\t\t\t\t window.FB.Event.subscribe('edge.create', function (url) {\n\t\t\t\t\t\t _kmq.push(['record', 'Like', { 'Shared URL': url }]);\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t window.FB.Event.subscribe('edge.remove', function (url) {\n\t\t\t\t\t\t _kmq.push(['record', 'Unlike', { 'Shared URL': url }]);\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t window.FB.Event.subscribe('auth.login', function (url) {\n\t\t\t\t\t\t _kmq.push(['record', 'Facebook Connect\\'d']);\n\t\t\t\t\t\t });\n\n\t\t\t\t\t\t window.FB.Event.subscribe('auth.logout', function (url) {\n\t\t\t\t\t\t _kmq.push(['record', 'Facebook Logout']);\n\t\t\t\t\t\t });\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t// Track search queries\n\t\t\t\tif( get_option( 'cc_kissmetrics_track_search' ) ) {\n\t\t\t\t\t?>_kmq.push(function() {\n\t\t\t\t\t\tif(document.getElementsByTagName('body')[0].className.match('search-results')) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar query = KM.uprts(decodeURIComponent(window.location.href)).params.s;\n\t\t\t\t\t\t\t\t_kmq.push(['record', 'Searched Site', {'WordPress Search Query': query}]);\n\t\t\t\t\t\t\t} catch(e) {}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t// Page-specific click listeners:\n\t\t\t\t// Grant Support: http://www.communitycommons.org/chi-planning/\n\t\t\t\tif( is_page( 28588 ) ) {\n\t\t\t\t\t?>_kmq.push(['trackClick', '.why-use-this-tool', 'Clicked Target Area Intervention Tool planning guide']);\n\t\t\t\t\t_kmq.push(['trackClick', '.how-to-use-this-tool', 'Clicked Target Area Intervention Tool step-by-step guide']);\n\t\t\t\t\t_kmq.push(['trackClick', '.access-target-intervention-area-tool', 'Clicked Target Area Intervention Tool']);\n\t\t\t\t\t_kmq.push(['trackClick', '.target-intervention-area-tutorial', 'Clicked Target Area Intervention Tool tutorial videos']);\n\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t// Front page views\n\t\t\t\tif ( is_front_page() ) {\n\t\t\t\t\t?>_kmq.push(['record', 'Viewed Site Front Page']);\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t// Blog page views\n\t\t\t\tif ( is_home() ) {\n\t\t\t\t\t?>_kmq.push(['record', 'Viewed Blog Homepage']);\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t// Taxonomy pages\n\t\t\t\t// Channel (category) pages\n\t\t\t\tif ( is_category() ) {\n\t\t\t\t\t$cat = array(\n\t\t\t\t\t\t'record',\n\t\t\t\t\t\t'Viewed Category',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'Viewed category archive' => single_cat_title( '', false ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $cat ); ?>);\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t\t// Tag pages\n\t\t\t\tif ( is_tag() ) {\n\t\t\t\t\t$tag = array(\n\t\t\t\t\t\t'record',\n\t\t\t\t\t\t'Viewed Tag',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'Viewed tag archive' => single_tag_title( '', false ),\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $tag ); ?>);\n\t\t\t\t\t<?php\n\t\t\t\t}\n\n\t\t\t\t// Other taxonomies\n\t\t\t\tif ( is_tax() ) {\n\t\t\t\t\tglobal $wp_query;\n\t\t\t\t\tif ( isset( $wp_query->query_vars['term'] ) ) {\n\t\t\t\t\t\t$tax_term = get_term_by( 'slug', $wp_query->query_vars['term'], $wp_query->query_vars['taxonomy'] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( $tax_term ) {\n\t\t\t\t\t\t$action = 'Viewed ' . $wp_query->query_vars['taxonomy'] . ' taxonomy term';\n\t\t\t\t\t\t$property_key = 'Viewed ' . $wp_query->query_vars['taxonomy'] . ' taxonomy term archive';\n\t\t\t\t\t\t$tax_item = array(\n\t\t\t\t\t\t\t'record',\n\t\t\t\t\t\t\t$action,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t$property_key => $tax_term->name,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $tax_item ); ?>);\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Search results page\n\t\t\t\tif ( is_search() ) {\n\t\t\t\t\tif ( $search_terms = get_search_query() ) {\n\t\t\t\t\t\t$search_record = array(\n\t\t\t\t\t\t\t'record',\n\t\t\t\t\t\t\t'Searched site',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'Site search terms' => $search_terms,\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $search_record ); ?>);\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* Viewing a Commons blog post.\n\t\t\t\t* @since 1.1.0\n\t\t\t\t*/\n\t\t\t\tif ( is_single() ) {\n\t\t\t\t\tif ( $post_id = get_the_ID() ) {\n\t\t\t\t\t\t// We're only interested in the posts written by IP3\n\t\t\t\t\t\t// staff for the Commons blog.\n\t\t\t\t\t\tif ( 'post' == get_post_type( $post_id ) ) {\n\t\t\t\t\t\t\t$post_event = array(\n\t\t\t\t\t\t\t\t'record',\n\t\t\t\t\t\t\t\t'Viewed Post',\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'Viewed post title' => get_the_title( $post_id ),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $post_event ); ?>);\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t// Record categories of interest.\n\t\t\t\t\t\t\t$categories = wp_get_object_terms( $post_id, 'category', array( 'fields' => 'names' ) );\n\t\t\t\t\t\t\tif ( ! empty ( $categories ) ) {\n\t\t\t\t\t\t\t\tforeach ( $categories as $cat_name) {\n\t\t\t\t\t\t\t\t\t$category_prop = array(\n\t\t\t\t\t\t\t\t\t\t'set',\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'Viewed post in category' => $cat_name,\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t?>_kmq.push(<?php echo json_encode( $category_prop ); ?>);\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t?>\n\t\t\t\tjQuery(document).ready(function() {\n <?php\n // Begin jQuery-based stuff\n // Clicks on \"Contact\" in the footer or \"Still Stuck\" on Support pages\n \t// Ticket submits have to be done another way--the ticket form is loaded in an iframe with a different domain, so we can't get data from it directly.\n $launched_zd = array(\n 'record',\n 'Opened support ticket creation dialog'\n );\n ?>jQuery('a[href^=\"https://ip3.zendesk.com\"]').click( function(e) {\n _kmq.push(<?php echo json_encode( $launched_zd ); ?>);\n });\n\n });\n\t\t\t\t</script>\n\t\t\t\t<?php\n\t\t\t}\n\n\t\t}",
"public function actionAnalytics_interactive(){\n\t\t$this->addScripts_GA();\n\t\t$this->render('analytics_interactive', [\n\t\t\t\"clientid\" => \"507571280579-rir2jneap7141vh6g66kr87ep44qmpph.apps.googleusercontent.com\"\n\t\t]);\n\t}",
"public function logsAction()\n {\n $block = $this->getLayout()->createBlock(\n 'ddg_automation/adminhtml_dashboard_tabs_logs'\n );\n $this->getResponse()->setBody($block->toHtml());\n }",
"private function trackActions()\n {\n $dateTime = $this->dateTime;\n\n $t = self::getTracker($this->idSite, $dateTime, $defaultInit = true, $useLocal = false);\n $t->setTokenAuth($this->tokenAuth);\n\n\n // First visitor with one visit with two actions without externalVisitId\n $t->setUserId('d9857faa8002a8eebd0bc75b63dfacef');\n\n $this->moveTimeForward($t, 0.1, $dateTime);\n $t->setUrl('http://example.com/');\n self::checkResponse($t->doTrackPageView('Viewing homepage'));\n\n $this->moveTimeForward($t, 0.3, $dateTime);\n $t->setUrl('http://example.com/');\n self::checkResponse($t->doTrackPageView('Second visit, should belong to existing visit'));\n\n\n // Second visitor with one visit with two actions with external_visit_id\n $t->setUserId('919c1aed2f5b1f79d27951b0b309ff42');\n\n $this->moveTimeForward($t, 0.1, $dateTime);\n $t->setUrl('http://example.com/');\n $t->setCustomTrackingParameter('external_visit_id', 12345);\n self::checkResponse($t->doTrackPageView('Viewing homepage'));\n\n $this->moveTimeForward($t, 0.3, $dateTime);\n $t->setUrl('http://example.com/');\n $t->setCustomTrackingParameter('external_visit_id', 12345);\n self::checkResponse($t->doTrackPageView('Second visit, should belong to existing visit'));\n }",
"function clicky_log( $a ) {\n # these are all available on the main preferences page for any web site!\n $site_id = \"100876280\";\n $sitekey_admin = \"20fec71b60fbdbf0\";\n \n $type = $a['type'];\n if( !in_array( $type, array( \"pageview\", \"download\", \"outbound\", \"click\", \"custom\", \"goal\" ))) $type = \"pageview\";\n \n $file = \"http://in.getclicky.com/in.php?site_id=\".$site_id.\"&sitekey_admin=\".$sitekey_admin.\"&type=\".$type;\n \n # referrer and user agent - will only be logged if this is the very first action of this session\n if( $a['ref'] ) $file .= \"&ref=\".urlencode( $a['ref'] );\n if( $a['ua'] ) $file .= \"&ua=\". urlencode( $a['ua'] );\n \n # we need either a session_id or an ip_address...\n if( is_numeric( $a['session_id'] )) {\n $file .= \"&session_id=\".$a['session_id'];\n }\n else {\n\n if( !$a['ip_address'] ) $a['ip_address'] = get_ip(); # automatically grab IP that PHP gives us.\n if( !preg_match( \"#^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$#\", $a['ip_address'] )) return false;\n $file .= \"&ip_address=\".$a['ip_address'];\n }\n \n # goals can come in as integer or array, for convenience\n if( $a['goal'] ) {\n if( is_array( $a['goal'] )) {\n foreach( $a['goal'] as $key => $value ) $file .= \"&goal[\".urlencode( $key ).\"]=\".urlencode( $value );\n }\n else {\n $file .= \"&goal[id]=\".$a['goal'];\n }\n }\n \n # custom data, must come in as array of key=>values\n foreach( $a['custom'] as $key => $value ) $file .= \"&custom[\".urlencode( $key ).\"]=\".urlencode( $value );\n \n \n if( $type == \"goal\" || $type == \"custom\" ) {\n # dont do anything, data has already been cat'd\n }\n else {\n if( $type == \"outbound\" ) {\n if( !preg_match( \"#^(https?|telnet|ftp)#\", $a['href'] )) return false;\n }\n else {\n # all other action types must start with either a / or a #\n if( !preg_match( \"#^(/|\\#)#\", $a['href'] )) $a['href'] = \"/\" . $a['href'];\n }\n \n $file .= \"&href=\".urlencode( $a['href'] );\n if( $a['title'] ) $file .= \"&title=\".urlencode( $a['title'] );\n }\n \n return file( $file ) ? true:false;\n}"
] | [
"0.67323846",
"0.6520755",
"0.65076643",
"0.6485758",
"0.63862836",
"0.61977434",
"0.61781406",
"0.6162596",
"0.61538184",
"0.60963255",
"0.60458237",
"0.600366",
"0.5937985",
"0.5925585",
"0.5911213",
"0.5873689",
"0.5856987",
"0.5849756",
"0.5845631",
"0.58396834",
"0.5839034",
"0.5838635",
"0.5795393",
"0.5760453",
"0.57073855",
"0.56794924",
"0.567945",
"0.56613386",
"0.56483257",
"0.5642862"
] | 0.7566517 | 0 |
< the ebay store id category this category refers to The constructor | public function __construct($category_id, $name, $ebay_id, $ebay_store_id){
//constructor sets class variables
$this->category_id = $category_id;//Category identifier
$this->category_name = $name;//Category name
$this->ebay_category_id = $ebay_id;//the real ebay category id
$this->setEbayCategoryFromDB($ebay_id);//set the ebaycategory object
$this->category_ebay_store_id = $ebay_store_id;//set the ebay storeID
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEbayCategory(){\n\t\treturn $this->ebay_category;\n\t}",
"public function getIdCategory(){\n\t\treturn $this->idCategory;\t\n\t}",
"public function _construct()\n {\n $this->_init('aukro/enginecategory', 'entity_id');\n }",
"public function getCategory_id()\n {\n return $this->category_id;\n }",
"public function __construct($catid)\n {\n $query = mysql_query(\"SELECT * FROM shop__category WHERE id = $catid\");\n $result = mysql_fetch_array($query);\n $this->id = $result['id'];\n $this->name = $result['name'];\n \n $shopquery = mysql_query(\"SELECT * FROM shop__list WHERE category = $catid\");\n while($shop = mysql_fetch_array($shopquery))\n {\n $this->shops[] = new Shop($shop['id']);\n }\n }",
"public function getIdCategory()\r\n {\r\n return $this->id_category;\r\n}",
"public function getIdCategory()\n {\n return $this->idCategory;\n }",
"public function getId_category()\n {\n return $this->id_category;\n }",
"public function getIdcategory()\n {\n return $this->idcategory;\n }",
"public function getCategoryID()\n {\n return $this->categoryID;\n }",
"public function getCategoryID() {\n\t\t\treturn \tget_cat_id($this->getCategoryName());\n\t\t}",
"public function getCateId()\n {\n return $this->cate_id;\n }",
"public function setEbayCategoryFromDB($ebay_id){\n\t\t$mysqli = new mysqli(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB);\n\t\t//SQL query to select ebay category data\n\t\t$sql = \"SELECT ebay_category_id, ebay_category_real_id, ebay_category_name, ebay_category_parent_id, ebay_category_level, ebay_category_leaf \n\t\t\t\tFROM ebay_category_tbl \n\t\t\t\tWHERE ebay_category_id = ?\";\n\t\t$stmt = $mysqli->prepare($sql);\n\t\t$stmt->bind_param('i', $ebay_id);\n\t\tif(!$stmt->execute()){\n\t\t\treturn \"Error: \".$stmt->errno.\" - \".$stmt->error;\t\n\t\t}else{\n\t\t\t$stmt->bind_result($ebay_category_id, $ebay_category_real_id, $ebay_category_name, $ebay_category_parent_id, $ebay_category_level, $ebay_category_leaf);\n\t\t\t$stmt->store_result();\n\t\t\tif($stmt->num_rows == 1){\n\t\t\t\t$stmt->fetch();\n\t\t\t\t$this->ebay_category = new EbayCategory($ebay_category_id, $ebay_category_real_id, $ebay_category_name, $ebay_category_parent_id, $ebay_category_level, $ebay_category_leaf);\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn \"Error: No Results\";\t\n\t\t\t}\t\n\t\t}\n\t}",
"public function getCategoryId()\n {\n return $this->category_id;\n }",
"public function getCategid()\n {\n return $this->categid;\n }",
"public function get_id_category()\n\t{\n\t\treturn $this->id_category;\n\t}",
"protected function _construct()\n {\n $this->_init('mgs_theme_catagory_setting', 'category_id');\n\t\t$this->_isPkAutoIncrement = false;\n }",
"protected function _construct()\n {\n $this->_init('mgs_portfolio_category', 'category_id');\n }",
"public function getCategory_id()\n{\nreturn $this->category_id;\n}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->categories = array();\n\t}",
"public function getCategoryId()\n {\n return $this->category_id;\n }",
"public function getCategoryId()\n {\n return $this->category_id;\n }",
"public function getCategories_id()\n {\n return $this->categories_id;\n }",
"public function getCategory()\n {\n return Mage::registry('category');\n }",
"public function __construct()\n\t{\n\t\t$this->pageTitle = GetConfig('StoreName') . \" - \" . GetLang('ShoppingCart');\n\n\t\tif($this->getQuote()->getNumitems() > 0) {\n\t\t\t$GLOBALS['KeepShoppingText'] = GetLang('ClickHereToKeepShopping');\n\t\t\t$GLOBALS['KeepShoppingLink'] = $GLOBALS['ShopPath'];\n\t\t} else {\n\t\t\t$GLOBALS['KeepShoppingText'] = '';\n\t\t\t$GLOBALS['KeepShoppingLink'] = '';\n\t\t}\n\n\t\tif (isset($_SESSION['JustAddedProduct']) && $_SESSION['JustAddedProduct'] != '') {\n\t\t\t// Get the category of the last product added to the store\n\t\t\t$query = sprintf(\"select c.categoryid, catname from [|PREFIX|]categoryassociations ca inner join [|PREFIX|]categories c on ca.categoryid=c.categoryid where ca.productid='%d' \", $GLOBALS['ISC_CLASS_DB']->Quote((int)$_SESSION['JustAddedProduct']));\n\t\t\t$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 1);\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\tif(CustomerGroupHasAccessToCategory($row['categoryid'])) {\n\t\t\t\t\t$GLOBALS['KeepShoppingLink'] = CatLink($row['categoryid'], $row['catname']);\n\t\t\t\t\t$GLOBALS['KeepShoppingText'] = sprintf(GetLang('ClickHereToKeepShoppingCat'), isc_html_escape($row['catname']));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function __construct($categoryId)\n {\n $this->categoryId = $categoryId;\n }",
"public function getCategoryId()\n {\n return (new CategoriesModel)->find($this->category_id, Categories::class);\n }",
"public function __construct(Category $category)\n {\n $this->category = $category;\n }",
"function category($id) {\n\t\t$this->categories[] = intval($id);\n\t}",
"protected function _initCategory() {\n $categoryId = (int) $this->getRequest()->getParam('id', false);\n $storeId = (int) $this->getRequest()->getParam('store');\n\n $category = Mage::getModel('catalog/category');\n $category->setStoreId($storeId);\n\n if ($categoryId) {\n $category->load($categoryId);\n if ($storeId) {\n $rootId = Mage::app()->getStore($storeId)->getRootCategoryId();\n if (!in_array($rootId, $category->getPathIds())) {\n $this->_redirect('*/*/', array('_current' => true, 'id' => null));\n return false;\n }\n }\n }\n\n Mage::register('category', $category);\n Mage::register('current_category', $category);\n\n return $category;\n }"
] | [
"0.6950691",
"0.6714801",
"0.66805905",
"0.65707254",
"0.65286225",
"0.6414181",
"0.6382714",
"0.6373533",
"0.63544333",
"0.6331819",
"0.63246006",
"0.63117594",
"0.6302128",
"0.62803423",
"0.626877",
"0.62481505",
"0.62378234",
"0.6234383",
"0.61688966",
"0.6148605",
"0.60893315",
"0.60893315",
"0.60802907",
"0.60797507",
"0.60754335",
"0.6071128",
"0.6049707",
"0.60450876",
"0.60312647",
"0.60295427"
] | 0.7347044 | 0 |
loads the categories ebay category object from the database | public function setEbayCategoryFromDB($ebay_id){
$mysqli = new mysqli(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB);
//SQL query to select ebay category data
$sql = "SELECT ebay_category_id, ebay_category_real_id, ebay_category_name, ebay_category_parent_id, ebay_category_level, ebay_category_leaf
FROM ebay_category_tbl
WHERE ebay_category_id = ?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('i', $ebay_id);
if(!$stmt->execute()){
return "Error: ".$stmt->errno." - ".$stmt->error;
}else{
$stmt->bind_result($ebay_category_id, $ebay_category_real_id, $ebay_category_name, $ebay_category_parent_id, $ebay_category_level, $ebay_category_leaf);
$stmt->store_result();
if($stmt->num_rows == 1){
$stmt->fetch();
$this->ebay_category = new EbayCategory($ebay_category_id, $ebay_category_real_id, $ebay_category_name, $ebay_category_parent_id, $ebay_category_level, $ebay_category_leaf);
return true;
}else{
return "Error: No Results";
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function load()\n {\n\n $objProductCategoryArr = array();\n\n $table = \"product_category\";\n $condition \t= \"\";\n $fields \t= \"*\";\n\n $row \t= Connection::getAllData($table, $condition, $fields, \"\", \"\");\n\n if( $row ) {\n\n foreach( $row as $resultRow ){\n\n $objProductCategory = new ProductCategory();\n $objProductCategory->setProductId($resultRow[\"product_id\"]);\n $objProductCategory->setCategoryId($resultRow[\"category_id\"]);\n\n $objProductCategoryArr[] = $objProductCategory;\n }\n\n }\n\n return $objProductCategoryArr;\n }",
"protected function loadCategories() {\n\n\n $class = $this->getClass();\n\n// $categories = $this->getObjectManager()->createQuery(sprintf('SELECT c FROM %s c WHERE c.user = :user ORDER BY c.parent ASC', $class))\n// ->setParameter('user', $this->user)\n// ->execute();\n\n $categories = $this->getObjectManager()->createQuery(sprintf('SELECT c FROM %s c WHERE c.user = :user ORDER BY c.parent ASC', $class))\n ->setParameter('user', $this->user)\n ->execute();\n if (count($categories) == 0) {\n // no category, create one for the provided context\n $category = $this->create();\n $category->setName('default');\n $category->setTitle('default');\n \n $category->setEnabled(true);\n $category->setPublic(false);\n $category->setUser($this->user);\n $category->setDescription('default category created by system');\n\n $this->save($category);\n\n $categories = array($category);\n }\n $root = array();\n foreach ($categories as $pos => $category) {\n if ($category->getParent() == null) {\n array_push($root, $category);\n }\n $this->categories[$this->userId][$category->getId()] = $category;\n $parent = $category->getParent();\n $category->disableChildrenLazyLoading();\n if ($parent) {\n $parent->addChild($category);\n }\n }\n\n $this->categories = array(\n 0 => $root\n );\n }",
"public function get_category(){\n \n $sql = 'SELECT * FROM categories';\n $data = $this->executerRequete($sql);\n $categories = array();\n foreach ($data as $element){\n $category = new \\Ent\\category($element);\n\n array_push($categories,$category);\n\n }\n\n return $categories;\n \n }",
"public function geteBayCategories($return_all = false)\n\t{\n\t\t$req = new GetCategoriesRequestType();\n\t\tif ($return_all) $req->setDetailLevel('ReturnAll');\n\t\t$res = $this->_sessionproxy->GetCategories($req);\n\t\t\n\t\tif ($res->Ack == 'Success')\n\t\t{\n\t\t\tMage::getModel('magebid/log')->logSuccess(\"import\",\"Category\",var_export($req,true));\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tMage::getModel('magebid/log')->logError(\"import\",\"Category\",var_export($req,true),var_export($res,true));\n\t\t\t$message = Mage::getSingleton('magebid/ebay_ebat_session')->exceptionHandling($res);\n\t\t\tMage::getSingleton('adminhtml/session')->addError($message);\t\n\t\t}\t\t\t\n\t}",
"public function getEbayCategory(){\n\t\treturn $this->ebay_category;\n\t}",
"public static function loadCategorySpecifics()\r\n\t{\r\n\t\t$request = new EbayRequest();\r\n\t\t$ebay_category_ids = EbayCategoryConfiguration::getEbayCategoryIds();\r\n\r\n\t\tforeach ($ebay_category_ids as $ebay_category_id)\r\n\t\t{\r\n\t\t\t$xml_data = $request->GetCategorySpecifics($ebay_category_id);\r\n\r\n\t\t\tforeach ($xml_data->Recommendations->NameRecommendation as $recommendation)\r\n\t\t\t{\r\n\t\t\t\t$required = isset($recommendation->ValidationRules->MinValues) && ((int)$recommendation->ValidationRules->MinValues >= 1);\r\n\r\n\t\t\t\t// if true can be used either in Item Specifics or VariationSpecifics\r\n\t\t\t\t$can_variation = !(isset($recommendation->ValidationRules->VariationSpecifics)\r\n\t\t\t\t\t&& ((string)$recommendation->ValidationRules->VariationSpecifics == 'Disabled'));\r\n\r\n\t\t\t\tif (isset($recommendation->ValidationRules->SelectionMode))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ((string)$recommendation->ValidationRules->SelectionMode == 'Prefilled')\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telseif ((string)$recommendation->ValidationRules->SelectionMode == 'SelectionOnly')\r\n\t\t\t\t\t\t$selection_mode = EbayCategorySpecific::SELECTION_MODE_SELECTION_ONLY;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$selection_mode = EbayCategorySpecific::SELECTION_MODE_FREE_TEXT;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$selection_mode = EbayCategorySpecific::SELECTION_MODE_FREE_TEXT;\r\n\r\n\t\t\t\t$values = array();\r\n\t\t\t\t\r\n\t\t\t\tif (isset($recommendation->ValueRecommendation->Value))\r\n\t\t\t\t\tforeach ($recommendation->ValueRecommendation as $value_recommendation)\r\n\t\t\t\t\t\t$values[] = (string)$value_recommendation->Value;\r\n\r\n\t\t\t\t$db = Db::getInstance();\r\n\t\t\t\t$db->execute('INSERT INTO `'._DB_PREFIX_.'ebay_category_specific` (`id_category_ref`, `name`, `required`, `can_variation`, `selection_mode`)\r\n\t\t\t\t\tVALUES ('. (int)$ebay_category_id.', \\''.pSQL((string)$recommendation->Name).'\\', '.($required ? 1 : 0).', '.($can_variation ? 1 : 0).', '.($selection_mode ? 1 : 0).')\r\n\t\t\t\t\tON DUPLICATE KEY UPDATE `required` = '.($required ? 1 : 0).', `can_variation` = '.($can_variation ? 1 : 0).', `selection_mode` = '.($selection_mode ? 1 : 0));\r\n\r\n\t\t\t\t$ebay_category_specific_id = $db->Insert_ID();\r\n\r\n\t\t\t\tif (!$ebay_category_specific_id)\r\n\t\t\t\t\t$ebay_category_specific_id = $db->getValue('SELECT `id_ebay_category_specific`\r\n\t\t\t\t\t\tFROM `'._DB_PREFIX_.'ebay_category_specific`\r\n\t\t\t\t\t\tWHERE `id_category_ref` = '.(int)$ebay_category_id.'\r\n\t\t\t\t\t\tAND `name` = \\''.pSQL((string)$recommendation->Name).'\\'');\r\n\r\n\t\t\t\t$insert_data = array();\r\n\r\n\t\t\t\tforeach ($values as $value)\r\n\t\t\t\t\t$insert_data[] = array(\r\n\t\t\t\t\t\t'id_ebay_category_specific' => (int)$ebay_category_specific_id,\r\n\t\t\t\t\t\t'value' => pSQL($value),\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\tEbayCategorySpecificValue::insertIgnore($insert_data);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"public function getBusinessCategoryByID($bussness_cat_id);",
"private function loadCategories()\n {\n //TODO: Adicionar suporte à tradução também às categorias.\n $this->view->categories = Order_Model_ProductCategory::fetchTree();\n }",
"public function loadAllCategories(){\n $this->pageNumber = 0;\n $categoryList = $this->mgrCategory->selectAllCategories();\n $this->displayCategoriesRows();\n }",
"public function loadCategories () {\n\t\tif ($xrefs = FilesCategories::where(['file_id' => $this->id])->get()) {\n\t\t\tforeach (array_keys($xrefs) as $category_id) { //loop to use the cache in Category::find\n\t\t\t\tif ($category = Category::find($category_id)) {\n\t\t\t\t\t$this->addCategory($category);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private function load_basecategories()\n {\n $storage = new midgard_query_storage('com_meego_package_basecategory');\n $q = new midgard_query_select($storage);\n\n $qc = new midgard_query_constraint(\n new midgard_query_property('name'),\n '<>',\n new midgard_query_value('')\n );\n\n $q->set_constraint($qc);\n $q->execute();\n\n return $q->list_objects();\n }",
"function loadCategories()\n {\n // Get a db connection so we can find the installed version from #__extensions\n $db = Factory::getDbo();\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('title'))\n ->from ($db->quoteName('#__categories'))\n ->where ($db->quoteName('extension') . ' = '. $db->quote('com_cajobboard'));\n\n $db->setQuery($query);\n\n return $db->loadColumn();\n }",
"function loadCateg($id) {\n unset($this->categ);\n $sql = \"SELECT linkcateg_id,\n linkcateg_title,\n linkcateg_parent_id,\n linkcateg_description,\n linkcateg_path\n FROM %s\n WHERE linkcateg_id = %d\n ORDER BY linkcateg_title\";\n $params = array($this->tableLinkdbCateg, $id);\n\n if ($res = $this->databaseQueryFmt($sql, $params)) {\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->categ = $row;\n }\n return TRUE;\n }\n return FALSE;\n }",
"public function getCategory(){\n \t$categories = CategoryModel::all();\n \treturn $categories; \n }",
"public function LoadListBookCategory(){\n\t\t\tglobal $DB, $GLOB;\n\t\t\t//lay thong tin so trang\n\t\t\tif(isset($_REQUEST['page_number'])){\n\t\t\t\t$page_num = intval($_REQUEST['page_number']);\n\t\t\t}else{\n\t\t\t\t$page_num = 1;\n\t\t\t}\n\t\t\t$bookperPage = 10;\n\t\t\t//glb\n\t\t\t$GLOB->obj_page_num = $page_num;\n\t\t\t//get max record\n\t\t\tif($data = $DB->query(\"SELECT sum(status) FROM book_category\")){\n\t\t\t\t$total = $data[0]['sum(status)'];\n\t\t\t}else{\n\t\t\t\t$total = 1;\n\t\t\t}\n\t\t\t$totalPage = ceil($total/$bookperPage);\n\t\t\t$GLOB->obj_page_total = $totalPage;\n\t\t\t$res = array();\n\t\t\t//Gioi han phan trang\n\t\t\t$start = ($page_num-1)*$bookperPage;\n\t\t\t$GLOB->TableStart = $start+1;\n\t\t\t$sql_add = \" LIMIT {$start}, {$bookperPage} \";\n\t\t\t//get data\n\t\t\tif($data = $DB->query(\"SELECT * FROM book_category {$sql_add}\")){\n\t\t\t\t$res = $data;\n\t\t\t}else{\n\t\t\t\t$res = false;\n\t\t\t}\n\t\t\treturn $res;\n\t\t}",
"public function initializeCategories() {\n $query = \"SELECT * FROM `codev_project_category_table` WHERE project_id = \" . $this->id . \";\";\n $result = SqlWrapper::getInstance()->sql_query($query);\n if (!$result) {\n echo \"<span style='color:red'>ERROR: Query FAILED</span>\";\n exit;\n }\n\n $this->categoryList = array();\n while ($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {\n $this->categoryList[$row->type] = $row->category_id;\n }\n }",
"public static function getCategories() {\n $db = Database::getDB();\n\n try {\n \n $query = 'SELECT * FROM categories ORDER BY categoryID';\n $statement = $db->prepare($query);\n $statement->execute();\n $categories = $statement->fetchAll();\n $statement->closeCursor();\n \n return $categories;\n\n } catch (PDOException $e) {\n $error_message = $e->getMessage();\n // display_db_error($error_message);\n }\n}",
"function getCategoryForOffer()\r\r\r\r {\r\r\r\r \tApp::import(\"Model\", \"Category\");\r\r\r\r \t$this->Category = &new Category();\r\r\r\r \t$conditions = ' Category.delete_status=0 AND Category.active_status IN (1,0) AND Category.parent_category = 0';\r\r\r\r \t$categorydata = $this->Category->find(\"all\", array('conditions' => $conditions));\r\r\r\r \t$categorydropdown = Set::combine($categorydata, '{n}.Category.id', '{n}.Category.category_name');\r\r\r\r \tasort($categorydropdown);\r\r\r\r \t$this->set(\"categorydropdown\", $categorydropdown);\r\r\r\r\r\r\r\r }",
"protected function _getCategoryModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_Store_Model_Category');\n\t}",
"public function modelListCategories(){\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select * from categories where displayhome=1 order by id desc\");\n\t\t\treturn $query->fetchAll();\n\t\t}",
"public function loadCategory($id)\n\t{\n\t\t$model=Category::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function getCategory(){\n $category = Mage::getModel(\"zangirolami_news/category\")->load(1);\n if($category && $category->getId()) { //se esiste e se ha un id\n return $category;\n }\n return false; //è come se fosse in un else\n }",
"public function load_field_cats() {\n // Load Field Cats\n if (empty($this->page_list) && empty($this->cat_list)) {\n $result = dbquery(\"SELECT * FROM \".$this->category_db.\" ORDER BY field_cat_order ASC\");\n if (dbrows($result) > 0) {\n while ($list_data = dbarray($result)) {\n if ($list_data['field_parent'] != '0') {\n $this->cat_list[$list_data['field_cat_id']] = $list_data['field_cat_name'];\n } else {\n $this->page_list[$list_data['field_cat_id']] = self::parse_label($list_data['field_cat_name']);\n }\n }\n }\n }\n if (empty($this->field_cat_index)) {\n $this->field_cat_index = dbquery_tree($this->category_db, 'field_cat_id', 'field_parent');\n }\n }",
"function ol_get_category_db() {\n\tglobal $ol_dbh;\n\n\t$stmt = $ol_dbh->prepare( 'SELECT * FROM mstore_category ORDER BY id DESC' );\n\t$stmt->execute();\n\n\treturn $stmt->fetchAll();\n}",
"function categoryInit(&$con) {\r\n try {\r\n $categories = $con->query('select * from category order by category_desc');\r\n\r\n if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {\r\n $id = $_GET['edit'];\r\n $stmt = $con->prepare('select * from category where category_id = ?');\r\n $stmt->bind_param('i', $id);\r\n\r\n if (!$stmt->execute()) {\r\n throw new \\Exception($stmt->error);\r\n }\r\n\r\n $result = $stmt->get_result();\r\n $editCat = $result->fetch_object();\r\n }\r\n\r\n return [\r\n $categories,\r\n isset($editCat) ? $editCat->category_desc : null,\r\n isset($editCat) ? $editCat->category_id : null,\r\n ];\r\n } catch (\\Throwable $e) {\r\n echo \"<p>Error: {$e->getMessage()}</p>\";\r\n }\r\n}",
"public function get_category_by_id($id_category){\n \n $sql = 'SELECT * FROM items WHERE id = ? ';\n $data = $this->executerRequete($sql, array($id_category));\n $categories = array();\n foreach ($data as $element){\n $category = new \\Ent\\category($element);\n\n array_push($categories,$category);\n\n }\n\n return $categories; \n \n }",
"public function getCategories(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n\n $query=\"SELECT `id`, `nombre` FROM `categoria`\";\n\n $this->db->get($query);\n }",
"public function Categories()\n {\n return BlogCategory::get();\n }",
"function find_categories_list(){\r\r\n\tApp::import(\"Model\",\"Category\");\r\r\n\t$this->Category = new Category();\r\r\n\t$data = $this->Category->find('list',array(\"fields\"=>array('id','title'),\"conditions\"=>array(\"Category.is_deleted\"=>0))); \r\r\n\treturn $data;\r\r\n }",
"function getAllCategory(){\n\t \t\tApp::import('model','Category');\n\t\t $this->Category = new Category(); \n\t\t\tApp::import('model','Subcategory');\n\t\t $this->Subcategory = new Subcategory();\n\t\t\t\n\t\t\t$categoryList = $this->Category->find('list', array('fields' => array('id', 'categoryname'),'order' => 'Category.order,Category.categoryname ASC','recursive' => -1,'conditions' => array('Category.publish' => 'yes')));\n\t\t\treturn $categoryList;\n\t }"
] | [
"0.6705678",
"0.6428199",
"0.63737446",
"0.6340204",
"0.62894964",
"0.62589085",
"0.6159498",
"0.61458206",
"0.6092995",
"0.6073979",
"0.6024553",
"0.60117805",
"0.60057",
"0.600023",
"0.5993829",
"0.598888",
"0.59800977",
"0.59181917",
"0.59052783",
"0.58904177",
"0.58809394",
"0.58806074",
"0.5870979",
"0.5861632",
"0.584908",
"0.5843342",
"0.5816332",
"0.5816172",
"0.58033407",
"0.57881963"
] | 0.66488075 | 1 |
returns the ebay category | public function getEbayCategory(){
return $this->ebay_category;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getCategory();",
"public function getCategory()\n {\n if (!$this->hasCategory() && $this->getCategoryId() > 0) {\n $this->setCategory(\n Mage::getModel('innobyte_emag_marketplace/category')\n ->load($this->getCategoryId())\n );\n }\n return $this->getData('category');\n }",
"public function getCategory(){\n\t\treturn $this->category;\t\n\t}",
"public function getCategory()\n {\n return $this->_data[self::CATEGORY];\n }",
"public function getCategory();",
"public function getCategory();",
"public function getCategory () \r\n {\r\n return $this->category;\r\n }",
"public function getCategory()\n {\n return Mage::registry('category');\n }",
"public function products_category()\n {\n \n $value = $this->buy_product_mdl->fetch_categories();\n return $value;\n }",
"public function getCategory(): string\n {\n return $this->category;\n }",
"public function getCategory() \n {\n return $this->category;\n }",
"public function getCategory()\n {\n }",
"public function getBusinessCategoryByID($bussness_cat_id);",
"function getCategory() {\n return $this->getCurrent()\n ->findParentRow('Yourdelivery_Model_DbTable_Restaurant_Categories');\n }",
"public function get_category()\n {\n return 'Fun and Games';\n }",
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Id = '.$this->CategoryId ) );\n\t}",
"public function getCategory()\n {\n return $this->getOptionValue(self::CATEGORY);\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category; \n\n\t}",
"public function getCategory()\n {\n \t\t$query=$this->db->where('type','income')->where('delete_status',0)->get('expense_category');\n\t \treturn $query->result();\n }",
"public function geteBayCategories($return_all = false)\n\t{\n\t\t$req = new GetCategoriesRequestType();\n\t\tif ($return_all) $req->setDetailLevel('ReturnAll');\n\t\t$res = $this->_sessionproxy->GetCategories($req);\n\t\t\n\t\tif ($res->Ack == 'Success')\n\t\t{\n\t\t\tMage::getModel('magebid/log')->logSuccess(\"import\",\"Category\",var_export($req,true));\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tMage::getModel('magebid/log')->logError(\"import\",\"Category\",var_export($req,true),var_export($res,true));\n\t\t\t$message = Mage::getSingleton('magebid/ebay_ebat_session')->exceptionHandling($res);\n\t\t\tMage::getSingleton('adminhtml/session')->addError($message);\t\n\t\t}\t\t\t\n\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }"
] | [
"0.6949601",
"0.69379944",
"0.6602309",
"0.6595844",
"0.65904653",
"0.65904653",
"0.65829843",
"0.6574534",
"0.6550618",
"0.65180784",
"0.65113664",
"0.6501094",
"0.6495357",
"0.6470296",
"0.6454996",
"0.64452785",
"0.64381325",
"0.64315206",
"0.6420094",
"0.63966763",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506",
"0.6387506"
] | 0.8622126 | 0 |
add a new category to our system by system storeID | public function addCategory($store_id){
$mysqli = new mysqli(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB);
$store_id = $mysqli->real_escape_string($store_id);
$category_name = $mysqli->real_escape_string($this->category_name);
$ebay_category_id = $mysqli->real_escape_string($this->ebay_category_id);
$ebay_store_category_id = $mysqli->real_escape_string($this->category_ebay_store_id);
//sql query to insert a new category
$sql = "INSERT INTO category_tbl (category_store_id, category_name, category_ebay_id, category_ebay_store_id) VALUES (?,?,?,?)";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('isii', $store_id, $category_name, $ebay_category_id, $ebay_store_category_id);
if(!$stmt->execute()){
return "Error: ".$stmt->errno." - ".$stmt->error;
}else{
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addStoreToCategory(string $id, AddStoreToNetworkCategory $request)\n {\n $category = $request->input('category');\n $store = $request->input('store');\n\n // get network store instance\n $networkStore = NetworkStore::where(['network_uuid' => $id, 'store_uuid' => $store])->first();\n\n if ($networkStore) {\n $networkStore->update(['category_uuid' => $category]);\n }\n\n return response()->json(['status' => 'ok']);\n }",
"protected function add_category( )\n {\n if(!empty($this->name_entity)) {\n \n if($this->model->create($this->name_entity)) \n array_push($this->messages, array('info', 'Categoría insertada correctamente!'));\n else \n array_push($this->messages, array('error', 'Error al insertar la categoría'));\n }\n \n $this->list_category();\n }",
"function add_category()\n\t{\n\t\tif(!empty($this->data))\n\t\t{\n\t\t\t//pr($this->data);\n\t\t\t$server_id=trim($this->data['wp_server_id']);\n\t\t\t$cat_name=trim($this->data['cat_name']);\n\t\t\t\n\t\t\tif($server_id== \"\" || $cat_name == \"\") //if user select blank combo or didn't enter category\n\t\t\t{\n\t\t\t\t$this->set('error',\"Please select server or enter category name\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tApp::import('Vendor', 'remotepost');\t\n\t\t\t\tif($server_id=='all')\n\t\t\t\t{\n\t\t\t\t\t$servers = $this->WpServer->find('all', array('fields' => array('WpServer.wp_admin_id','WpServer.wp_admin_password','WpServer.rpc_url'),'conditions'=>array('WpServer.user_id' => $this->Session->read('user_id'))));\n\t\t\t\t\tforeach($servers as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->client = new IXR_Client($servers[$key]['WpServer']['rpc_url']);\n\t\t\t\t\t\t$details['name']=$cat_name; //used for sending parameters in newCategory\n\t\t\t\t\t\tif($this->client->query('wp.newCategory','',$servers[$key]['WpServer']['wp_admin_id'],$servers[$key]['WpServer']['wp_admin_password'],$details))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->client->getResponse();\n\t\t\t\t\t\t\t$this->set('message',\"Category added successfully\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->set('error',\"Category could not be added. Please Try again.\");\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t$message.=\"SERVER :\" .$servers[$key]['WpServer']['rpc_url'].\":\".$this->client->getErrorCode().\":\".$this->client->getErrorMessage();\n\t\t\t\t\t\t\t$message.='<br>';*/\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end for\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$server=$this->WpServer->findById($server_id);\n\t\t\t\t\t$this->client = new IXR_Client($server['WpServer']['rpc_url']);\n\t\t\t\t\t$details['name']=$cat_name; //used for sending parameters in newCategory\n\t\t\t\t\tif($this->client->query('wp.newCategory','',$server['WpServer']['wp_admin_id'],$server['WpServer']['wp_admin_password'],$details))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->client->getResponse();\n\t\t\t\t\t\t$this->set('message',\"Category added successfully\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$this->set('error',\"Category could not be added. Please Try again.\");\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$message.=\"SERVER :\" .$server['WpServer']['rpc_url'].\":\".$this->client->getErrorCode().\":\".$this->client->getErrorMessage();\n\t\t\t\t\t\t$message.='<br>';*/\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}//end else \n\t\t\t\n\t\t} //if not empty(this->data)\n\t\t$servers=$this->WpServer->find('list',array('fields' => 'WpServer.name','conditions' => array('WpServer.user_id' => $this->Session->read('user_id'))));\n\t\tasort($servers);\n\t\t//pr($servers);\n\t\t$this->set('wp_server_ids',$servers); //load all wp_servers in combo box from local table\n\t\t$this->render('add_category','modalbox');\n\t}",
"function ol_add_category_db( $category, $action = '' ) {\n\tglobal $ol_dbh;\n\n\tif ( 'update' === $action ) {\n\t\t$stmt = $ol_dbh->prepare( 'UPDATE mstore_category SET category = :category WHERE id = :id' );\n\t\t$stmt->bindParam( ':id', $category['id'] );\n\t} else {\n\t\t$stmt = $ol_dbh->prepare( 'INSERT INTO mstore_category (category) VALUES (:category)' );\n\t}\n\n\t$stmt->bindParam( ':category', $category['category'] );\n\n\treturn $stmt->execute();\n}",
"function addCategory(){\n\t\tif($_REQUEST['categoryName'] != ''){\n\t\t$date = microtime(true);\n\n\t\t$count=\"SELECT * FROM categories\"; \n\t\t$result=$this->pdo->query($count);\n\t\t$idnum=$result->rowCount();\n\n\t\tif(isset($_REQUEST['selectedCategory'][0])){\n\t\t$name=$_REQUEST['selectedCategory'][0].'/';\n\t\t}\n\n\t\t$type=$_REQUEST['type'];\n\t\t$name.=$_REQUEST['categoryName'];\n\n\t\t$sql = \"INSERT INTO categories (id,date,type,name)\n\t\t\tVALUES\n\t\t\t( ?, ?, ?, ?)\n\t\t\t \";\n\n\t\t\t$stmt=$this->pdo->prepare($sql);\n\t\t\t$r=$stmt->execute(array($idnum +1,$date,$type,$name));\n\n\t\t\tif (!$r) {\n\t\t\t\techo 'Database prepare error';\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}",
"public function store($data){\n\t\t$model = new Category();\n\t\t$category = $model->addNew($data);\n\t\theader('Location: ?mod=category&act=list');\n\t}",
"function cfcpt_add_new_cat() {\n\t\tif (!current_user_can('manage_categories')) {\n\t\t\twp_die(__('Cheatin’ uh?'));\n\t\t}\n\n\t\tif($newcat_id = wp_insert_category($_POST)) {\n\t\t\twp_redirect('edit.php?page=cf-custom-posts&status=add_success&new_cat='.$newcat_id);\n\t\t} \n\t\telse {\n\t\t\twp_redirect('edit.php?page=cf-custom-posts&status=add_failed');\n\t\t}\n\t\texit;\n\t}",
"function add_category($cat_name) {\n global $conn, $active_company;\n\n \t$sql = sprintf(\"SELECT id FROM itemcategory WHERE name=%s\",sqlprep($cat_name));\n \t$result = $conn->Execute($sql) or print($conn->ErrorMsg());\n \t$catpk = $result->fields[0];\n \n \tif (!$catpk and $cat_name) {\n $sql = sprintf(\"INSERT INTO itemcategory (name) VALUES (%s)\",sqlprep($cat_name));\n\t $result = $conn->Execute($sql) or print($conn->ErrorMsg());\n\t $catpk = $conn->Insert_ID();\n \t}\n\treturn $catpk ;\n }",
"public function createCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('INSERT INTO Categories (instantiated, Name, Description, imgURL, date_memory)\n VALUES (:instantiated,:Name, :Description, :imgURL, :date)');\n $query->bindValue(':instantiated', $this->instantiated, PDO::PARAM_STR);\n $query->bindValue(':Name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->description, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->bindValue(':date', $this->date, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"function add_new_category ($category_id, $categoryname) {\n\t$category_id = (int)$category_id;\n\tmysql_query(\"INSERT INTO `mock_exam_category` (`category_id`, `category_name`, `status`, `date_created`) VALUES ('$category_id', '$categoryname', '1', CURRENT_TIMESTAMP)\");\n}",
"public function addOrUpdateCategory($id = null);",
"function add_cat($name)\n{\n $tab = get_tab(\"cat\");\n array_push($tab, $name);\n save_tab(\"cat\", $tab);\n return;\n}",
"function category_create($category) {\n\tif (!category_exists($category)) {\n\t\t$_ENV['dbi']->insert('categories',array('category'=>trim($category)),1);\n\t}\n}",
"public function create_category ()\n\t{\n\t\tupdate_option(self::option_string($_POST['tag-name']), isset($_POST['is_secure']));\n\t}",
"public function addCategoryDb()\n\t{\n\t\t$data = array(\n\t\t\t\t\t'CategoryName' => $this->input->post('CategoryName'),\n\t\t\t\t\t'Description' => $this->input->post('Description')\n\t\t\t\t);\n\t\t$this->categories_model->addCategory($data); //passing variable $data ke products_model\n\n\t\tredirect('categories'); //redirect page ke halaman utama controller products\n\t}",
"function addStore($new_store)\n {\n //to avoid duplicate entries in database\n $existing_store = Store::findByName($new_store->getName());\n\n if($existing_store == null){\n $new_store->save();\n $GLOBALS['DB']->exec(\"INSERT INTO brands_stores (brand_id, store_id)\n VALUES ({$this->getId()}, {$new_store->getId()});\");\n }\n else {\n if ($this->notInStore($new_store)) {\n $GLOBALS['DB']->exec(\"INSERT INTO brands_stores (brand_id, store_id)\n VALUES ({$this->getId()}, {$existing_store->getId()});\");\n }\n }\n\n\n }",
"public function storeCategory($data){\n $category_record = array(\n 'image' => $data['category']['image'],\n 'top' => (!empty($data['category']['top']) && $data['category']['top'] == \"on\") ? 1 : 0,\n 'order' => is_numeric(trim($data['category']['order'])) ? (int) trim($data['category']['order']) : 0,\n 'status' => is_numeric(trim($data['category']['status'])) ? (int) trim($data['category']['status']) : 0,\n 'parent' => $data['category']['parent'],\n 'products' => array()\n );\n \n $insertId = $this->insertCategoryGetId($category_record);\n\n //detect language\n $arrLang = $this->language->getLang();\n\n if(count($arrLang) > 0){\n foreach ($arrLang as $key => $lang) {\n //save category description record\n $dataRecord = $data[$lang['alias'].'_category'];\n $category_alias = url_slug($dataRecord['name']); \n $catDescRecord[$lang['alias']][$lang['alias']][$category_alias] = array(\n 'cat_id' => $insertId,\n 'alias' => $category_alias,\n 'name' => $dataRecord['name'],\n 'description' => $dataRecord['description'],\n 'keyword' => $dataRecord['keyword']\n );\n $this->cimongo->insert('category_description',$catDescRecord[$lang['alias']]);\n }\n }\n }",
"public function createCategory();",
"public function store(CategoryStoreRequest $request)\n {\n if($request->has('slug')){\n $slug = $request->input('slug');\n $slug = Str::slug($slug, '-');\n $request->merge(['slug' => $slug]);\n }\n\n\n Category::create($request->all());\n\n return redirect()->route('categories.index')\n ->with('success', 'Category created successfully.');\n }",
"function add() {\n ## Load config and store\n $CFG = $this->config->item('user_category_configure');\n $data[\"title\"] = _e(\"User Category\");\n $data[\"response\"] = addPermissionMsg($CFG[\"sector\"][\"add\"]);\n $data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"user_category\");\n $data[\"content\"] = $this->template->admin_view(\"user_category_add\", $data, true, \"user_category\");\n $this->template->build_admin_output($data);\n }",
"public function store(NewCat $request)\n {\n $site = Request()->get('_site');\n $cat = new Category;\n\n $cat->name = $request->name;\n $cat->subCatOf = $request->subCatOf;\n $cat->site = $site->id;\n\n if (isset($request->orderOf)) {\n $cat->orderOf = $request->orderOf;\n }\n\n $cat->save();\n return redirect('/'.$site->slug.'/settings/categories');\n }",
"function ot_add_category($version_id, $category_name)\n{\n $project_id = ot_get_project_id_from_version_id($version_id);\n\t\n // find out how many categories are already listed\n $query = mysql_query(\"\n SELECT count(*)\n FROM tr_project_categories\n WHERE project_id = $project_id\n \");\n\n $result = mysql_fetch_row($query);\n\n $num_project_categories = $result[0];\n\n $category_order = $num_project_categories + 1;\n $category_name = mysql_real_escape_string($_POST['new_category']);\n\n // find out how many categories are already listed\n $query = mysql_query(\"\n INSERT INTO tr_project_categories\n SET project_id = $project_id,\n parent_category_id = 0,\n category_name = '$category_name',\n category_order = $category_order\n \");\n}",
"public function store(Request $request,$store_id)\n {\n $category = ProductCategory::create($request->all() + ['store_id' => $store_id]);\n return $category->toJson();\n }",
"public function sql_insert()\n\t{\n\t\tparent::sql_insert();\n\t\tif (!is_null($this->categories))\n\t\tforeach ($this->categories as $cat) {\n\t\t\tCategorizedItem::add($cat, $this->slug);\n\t\t}\n\t}",
"public function AddCategoryAction() {\r\n\r\n $html = $this->getLayout()->createBlock('CrmTicket/Admin_Category_New')->setTemplate('CrmTicket/Category/New.phtml')->toHtml();\r\n\r\n $this->getResponse()->setBody($html);\r\n }",
"function newCategory($data){\n\t\t$this->db->insert('categorias', array('nombre' => $data['nombre']));\n\t}",
"public function store(Requests\\CategoryStoreRequest $request)\n {\n Category::create($request->all());\n\n return redirect('/backend/categories')->with('message', 'Kategori berhasil di buat!.');\n }",
"static function addCategory($params){\n /*$con =$params['dbconnection'];\n\t\tif($categoryexist=DbMethods::checkCategory($params)=='categoryexist') return 'categoryexist';\n\t\t$query = \"INSERT INTO `category` SET\n\t\t`name`='{$params['name']}',\n\t\t`image`='{$params['image']}'\" ;\n\t\tmysqli_query($con,$query) ;\n\t\tif (mysqli_error($con) != '')\n\t\treturn \"mysql_Error:-\".mysqli_error($con);\n\t\t$id=mysqli_insert_id($con);\n\t\t\n\t\t$params['table_name']='category';\n\t\t$params['id']=$id;\n\t\t$params['table_id']=$id;\n\t\t$params['admin_logstype']='add';\n\t\tDbMethods::logs($params);\n\t\t\n\t\treturn array(\"id\"=>(int)$id) ;*/\n return \"added\";\n }",
"public function store(addCategoryRequest $request)\n {\n $category = $request->all();\n Category::create($category);\n /*Category::create(['name'=>$request->name,'slug'=>str_slug($request->name)]);*/\n Toastr::success('Your category has been successfully added !' ,'Congratulations !');\n return redirect()->route('admin.categories.index');\n }",
"public function addCategory()\n {\n\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == ADMIN) {\n\n //check post variable\n if (isset($_POST['category_name'])) {\n\n //test values\n $name = Validator::testInput($_POST['category_name']);\n\n //session variable\n $_SESSION['new_category_name'] = $name;\n\n //get user id\n $id = UserManager::getUserByEmail($_SESSION['email'])['id'];\n\n if (Validator::checkText($name)) {\n\n //create category\n $category = new CategoryModel($name, $id);\n\n //try to add category\n if (CategoryManager::addCategory($category)) {\n\n //delete session variables\n unset($_SESSION['new_category_name']);\n\n MessageManager::setSuccessMsg('Categoria creata con successo');\n MessageManager::unsetErrorMsg();\n header('Location: ' . URL . 'category');\n\n } else {\n MessageManager::setErrorMsg(\"Categoria già esistente\");\n }\n } else {\n MessageManager::setErrorMsg(\"La categoria deve essere composta solo da lettere, max 50 caratteri\");\n }\n }\n //reload add category page\n $this->showAddCategoryPage();\n exit;\n }\n //redirect to catalog page\n header('Location: ' . URL . 'catalog/');\n exit;\n }\n header('Location: ' . URL . 'home/index');\n exit;\n }"
] | [
"0.68770653",
"0.68404555",
"0.67239654",
"0.66949356",
"0.66901094",
"0.66867626",
"0.65823716",
"0.6576779",
"0.64439183",
"0.64266133",
"0.6423122",
"0.63910115",
"0.6329886",
"0.6325098",
"0.62938553",
"0.6266841",
"0.6258805",
"0.6257188",
"0.6242599",
"0.62357265",
"0.6226741",
"0.6205856",
"0.6179847",
"0.61787605",
"0.6171256",
"0.61642134",
"0.61612904",
"0.61608064",
"0.61560196",
"0.6152231"
] | 0.7633501 | 0 |
update a sellers store category | public function updateCategory(){
$mysqli = new mysqli(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB);
$cat_id = $mysqli->real_escape_string($this->category_id);
$cat_name = $mysqli->real_escape_string($this->category_name);
$ebay_cat = $mysqli->real_escape_string($this->ebay_category->id);
$ebay_store_cat = $mysqli->real_escape_string($this->category_ebay_store_id);
//sql query to update an existing category
$sql = "UPDATE category_tbl
SET category_name = ?, category_ebay_id = ?, category_ebay_store_id = ?
WHERE category_id = ?";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('siii', $cat_name, $ebay_cat, $ebay_store_cat, $cat_id);
if (!$stmt->execute()) {
return "Error: " . $mysqli->errno . " - " . $mysqli->error;
}else{
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCategory()\n\t{\n\t}",
"public function update(StoreCategory $request, $id){\n $category = Category::findOrFail( $id );\n $category->update( $request->input() );\n return redirect()->route('admin.category.index');\n }",
"public function update(Request $request,$store_id, $id)\n {\n $category = ProductCategory::find($id);\n $category->fill($request->except(['store']));\n $category->save();\n return Response::json(['message'=>'success']);\n }",
"public function updateCategoryDb()\n\t{\n\t}",
"function update($category_id)\n\t{\n\n\t}",
"public function update( Store $store, StoreCategoryRequest $storeCategoryRequest, StoreCategory $storeCategory ) : JsonResponse\n {\n return $this -> theRepository -> update( $store, $storeCategoryRequest, $storeCategory );\n }",
"private function _updateCategory($cat_names) {\n foreach ($cat_names as $cat_name) {\n $this->_updateMarketPrice($cat_name['name'],\n $cat_name['market_price']);\n }\n }",
"public function update(StoreCategory $request, Category $category)\n {\n $category->name = $request->name;\n\n if($category->save()){\n return redirect()->route('tags.index')->with([\n \"status\"=> \"Success\",\n \"message\"=> \"You have successfully added a new Category\",\n \"color\"=> \"success\"\n ]);\n }\n else{\n return redirect()->route('tags.index')->with([\n \"status\"=> \"Failure\",\n \"message\"=> \"Unfortunately the new Category did not save correctly\",\n \"color\"=> \"danger\"\n ]);\n };\n }",
"public function update(StoreCategory $request, $id)\n {\n $category = Category::find($id);\n $category->fill([\n 'name' => $request->name,\n 'description' => $request->description,\n 'is_active' => $request->is_active\n ]);\n $category->save();\n\n \n session()->flash('alert', 'Categoria alterada com sucesso!');\n return back();\n }",
"public function updated(Category $category)\n {\n\n\n }",
"public function updating(Category $Category)\n {\n //code...\n }",
"public function updated(Category $Category)\n {\n //code...\n }",
"public function update(Request $request) {\n\t\t\t// Update product by Than Ravy\n\n\t\t$my_id=preg_replace('#[^0-9]#','',$request->get('id'));\n\t\tif(!empty($my_id)){\n\t\t\t$this->c->where('cat_id',$my_id)->update([\n\t\t\t\t'cat_name'=>$request->get('cat_name')\n\t\t\t]);\n\t\t\t\\Session::flash ('message', 'Update Successful');\n\t\t\treturn redirect ('category');\n\t\t}\n\t\t$this->edit ();\n\t}",
"public function modifyCategory()\n {\n $pdo = DBConfig::openConnection();\n $query = $pdo->prepare('UPDATE Categories SET Name=:Name, Description=:Description, imgURL=:imgURL WHERE classID=:classID');\n $query->bindValue(':classID', $this->classID, PDO::PARAM_STR);\n $query->bindValue(':Name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':Description', $this->description, PDO::PARAM_STR);\n $query->bindValue(':imgURL', $this->imgURL, PDO::PARAM_STR);\n $query->execute();\n $query->CloseCursor();\n DBConfig::closeConnection($pdo);\n }",
"public function action_update() {\n if (isset($_POST) && Valid::not_empty($_POST)) {\n $post = $this->getValidationFactory($_POST);\n $category = new Model_ProductCategory($post['id'], \n $post['name'], $post['parent'], '', \n $post['order']);\n $repo = new Repository_ProductCategory();\n $parents = $repo->getParents($post['id']);\n \n if ($post->check()) {\n // Update the supplier\n $success = $repo->update($category);\n \n // Redirect if the update was successful\n if ($success) {\n Session::instance()->set('feedbackMessage', array('The product category was updated.'));\n $this->redirect ('productCategory/findAll');\n } else {\n $feedbackMessage = array('An error occured.');\n }\n } else {\n // Invalid fields\n $feedbackMessage = $post->errors('productCategories');\n }\n \n $view = View::factory('product/category')\n ->set('category', $category)\n ->set('parents', $parents)\n ->set('submitAction', 'productCategory/update')\n ->set('pageName', 'Edit Product Category');\n \n $this->template->title = __('Edit Product Category');\n $this->template->feedbackMessage = $feedbackMessage;\n $this->template->content = $view;\n } else {\n // Empty POST\n Session::instance()->set('feedbackMessage', array('An error occured.'));\n $this->redirect ('productCategory/findAll');\n }\n }",
"public function update($site, NewCat $request, Category $category)\n {\n $site = Request()->get('_site');\n $category->name = $request->name;\n $category->subCatOf = $request->subCatOf;\n\n if (isset($request->orderOf)) {\n $category->orderOf = $request->orderOf;\n }\n\n $category->save();\n\n return redirect('/'.$site->slug.'/settings/categories');\n }",
"public function update(Request $request, Category $category){\n Gate::authorize('update', $category);\n\n $request->validate([\n 'category_name' => [\n 'required',\n 'string',\n Rule::unique(Category::class, 'name')->where(function ($query) use($request){\n return $query->where('seller_id', $request->user()->seller->id);\n })->ignore($category->id)\n ]\n ]);\n\n $category->name = $request->category_name;\n $category->save();\n\n return redirect()->route('manage.categories.index')->with([\n 'success' => 'Data berhasil diperbarui.'\n ]);\n }",
"private function _updateMarketPrice($cat_name,$market_price) {\n $query=\"UPDATE \".DB_PREFIX.\"category c LEFT JOIN \".DB_PREFIX.\"\"\n . \"category_description cd ON c.category_id =\"\n . \"cd.category_id SET metal_price=\"\n . \"'\".$market_price.\"' \"\n . \" WHERE cd.name='\".$cat_name.\"'\";\n \n $this->db->query($query);\n }",
"function setCategory($ITD,$CAT){\n\t$conn=conDB();\n\t$sql=\"UPDATE items SET CatID='$CAT' WHERE IDKey='$ITD'\";\n\tmysqli_query($conn, $sql);\n}",
"function modifyCategory($idCategory){\r\n\t}",
"public function update() {\n global $database;\n $sql = \"UPDATE category SET \";\n $sql .= \"category_name = '\".$database->escape_value($this->category_name);\n $sql .= \"', category_description = '\".$database->escape_value($this->category_description);\n $sql .= \"', category_value = '\".$database->escape_value($this->category_value);\n $sql .= \"', is_reward = '\".$database->escape_value($this->is_reward);\n $sql .= \"', for_self = '\".$database->escape_value($this->for_self);\n $sql .= \"', is_editable = '\".$database->escape_value($this->is_editable);\n $sql .= \"', status_id = '\".$database->escape_value($this->status_id);\n $sql .= \"' WHERE id=\".$database->escape_value($this->id);\n\n if ($database->query($sql)) {\n return true;\n } else {\n return false;\n }\n }",
"public function updateCategory($id,$options);",
"public function updated(Seller $seller)\n {\n //\n }",
"public function update(Request $request, Productcat $productcat)\n {\n //\n }",
"public function set_category(){\r\n\t\t\r\n\t\t/* Get arguments */\r\n\t\t$args = $this->_args;\r\n\t\tif (empty($args)){\r\n\t\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')));\r\n\t\t}\r\n\t\t\r\n\t\t/* Set category */\r\n\t\t$itemId = array_shift($args);\r\n\t\t$categoryId = Request::getInt('categoryId');\r\n\t\t$itemsModel = $this->getModel('newitems');\r\n\t\t$success = $itemsModel->updateCategory($itemId, $categoryId);\r\n\t\t\r\n\t\t/* Get category */\r\n\t\t$categories = $itemsModel->getItemCategories($this->_getType('key'));\r\n\t\t$categoryName = Utility::multi_array_get($categories, $categoryId, false);\r\n\t\t\r\n\t\t/* Message */\r\n\t\tif ($success && $categoryName){\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' category set to \"<code>'.$categoryName.'</code>\"');\r\n\t\t} else {\r\n\t\t\tMessages::addMessage($this->_getType('singular').' #'.$itemId.' was not changed.', 'error');\r\n\t\t}\r\n\t\t\r\n\t\t/* Redirect to details page */\r\n\t\treturn $this->_redirect('/'.strtolower($this->_getType('plural')).'/details/'.$itemId);\r\n\t\t\r\n\t}",
"public function update()\n {\n if(!isset($_POST['category_id'])) {\n $_POST['category_id'] = 0;\n }\n App::get('database')->update('products', $_POST, $_POST['id']);\n return redirect('admin/products');\n }",
"public function update(Request $request){\n $category = Category::find($request->id);\n $category->cat_Name = $request->cat_Name;\n $category->update();\n\n\n // $profile = Profile::where('category', '=', $request->old_cat_name);\n // $profile->category = $request->cat_Name;\n // $profile->update();\n $data = array();\n $data['category']= $request->cat_Name;\n\n DB::table('profiles')\n ->where('category',$request->old_cat_name)\n ->update($data);\n return redirect('/allcategories');\n\n }",
"private function update_cat_item_count($cat_id,$site_id=site_id) {\n $item_count=$this->get_children_items_number($cat_id,$site_id);\n\n //update cat's item_count\n try {\n\n $stm=$this->uFunc->pdo(\"uCat\")->prepare(\"UPDATE \n u235_cats\n SET\n item_count=:item_count \n WHERE \n cat_id=:cat_id AND\n site_id=:site_id\n \");\n $stm->bindParam(':item_count', $item_count,PDO::PARAM_INT);\n $stm->bindParam(':cat_id', $cat_id,PDO::PARAM_INT);\n $stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n $stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('uCat/common/370'/*.$e->getMessage()*/);}\n }",
"public function edit_category ()\n\t{\n\t\tupdate_option(self::option_string($_POST['name']), isset($_POST['is_secure']));\n\t}",
"public function update(Request $request, booksCategory $booksCategory)\n {\n //\n }"
] | [
"0.7154625",
"0.66945547",
"0.66348714",
"0.6506243",
"0.6376582",
"0.62055",
"0.6204254",
"0.6203924",
"0.6173697",
"0.6156805",
"0.61176956",
"0.61075497",
"0.6091181",
"0.6052411",
"0.6019565",
"0.60106266",
"0.6010566",
"0.60060585",
"0.60028154",
"0.5990704",
"0.59749204",
"0.5958278",
"0.5937767",
"0.59122413",
"0.59047854",
"0.5892932",
"0.5891712",
"0.5875321",
"0.58722514",
"0.5870633"
] | 0.7002222 | 1 |
get all customer country | public function get_country_get()
{
$country = $this->_customer->get_all_country();
$this->response($country);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllCountries();",
"public function CountryAll()\n {\n return Country::all();\n }",
"abstract public function getCountriesList();",
"function countryList()\n {\n $arrClms = array(\n 'country_id',\n 'name',\n );\n $varOrderBy = 'name ASC ';\n $arrRes = $this->select(TABLE_COUNTRY, $arrClms);\n return $arrRes;\n }",
"public function getCountries()\n {\n return $this->get('/countries');\n }",
"public function getCountries() {\n $this->db->query('SELECT * FROM tbl_country');\n return $this->db->resultSet();\n }",
"public function getCountries()\n\t{\n\t\treturn $this->call('get', 'Countries');\n\t}",
"public function getAvailableCountries ();",
"public function getCountries()\n {\n return $this->request('countries', 'GET');\n }",
"public function fetchAllCountries(){\n $answ = $this->getRequest('getCountries',null);\n $to_array = json_decode($answ,true);\n return $to_array; \n }",
"public function countriesList()\n {\n return $this->client->makeRequest(\n '/reference/countries',\n RetailcrmHttpClient::METHOD_GET\n );\n }",
"public function getCountries()\n {\n return $this->query(\"SELECT * FROM bird_countries\");\n }",
"public function listCountries() {\n\t\t\t$data = Cache::request(\"http://www.freecurrencyconverterapi.com/api/v2/countries\");\n\n\t\t\t//Convert this data into an associative array\n\t\t\t$data = json_decode($data, true);\n\n\t\t\treturn $data;\n\t\t}",
"public function getCountries()\n {\n $response = $this->client->request(\n 'GET',\n 'https://api.setlist.fm/rest/1.0/search/countries',\n [\n 'headers' => [\n 'x-api-key' => '24LpnzjvbvX5AsxiSJS9ZsPkATNgtY2996EH',\n 'Accept' =>'application/json',\n 'Accept-Language' => 'fr',\n ],\n ]\n );\n \n return $response->toArray();\n }",
"public function getCountries()\n {\n // $results->sortBy('label');\n // return $results;\n\n return Country::orderBy('label')->where('rowid', '>' , 0)->get();\n }",
"public function countryList()\n\t{\n\t\t$sql = \"SELECT * FROM api_countries\";\n\t\t$result = mysql_query($sql,$this->connection);\n\t\treturn $result;\n\t}",
"public function getCountries() \n {\n return $this->getResource('countries');\n }",
"public function getCountry();",
"public function getCountry();",
"public function getCountry();",
"public function getAllCountries()\n {\n $countries = Country::orderBy('country_name', 'asc')->get();\n return $countries->pluck('country_name', 'id')->toArray();\n }",
"public function getAllCountry() {\n\n\t\t$category = new Address();\n\t\t$rawData = $category->getAllCountries();\n\n\t\tif(empty($rawData)) {\n\t\t\t$statusCode = 404;\n\t\t\t$rawData = array('error' => 'No mobiles found!');\n\t\t} else {\n\t\t\t$statusCode = 200;\n\t\t}\n\n\t\t$requestContentType = $_SERVER['CONTENT_TYPE'];\n\t\t$this ->setHttpHeaders($requestContentType, $statusCode);\n\n\t\tif(strpos($requestContentType,'application/json') !== false){\n\t\t\t$response = $this->encodeJson($rawData);\n\t\t\techo $response;\n\t\t}\n\t}",
"public function getCountries()\n {\n return $this->countries;\n }",
"public function getCountries()\n {\n return $this->countries;\n }",
"function get_all_users_countries(){\n\t\t$cache_key = 'site_users'.'-all-users-countries';\n return get_from_cached( array(\n 'cache_key' => $cache_key,\n ) );\n\t}",
"public function getCountryList()\n {\n return $this->countryList;\n }",
"public static function getCountries()\n {\n return self::$_countryList;\n }",
"function countries_get()\n\t{\n\t\t$fields=array('country_code','country_name');\n\t\t$countries=$this->user_model->get_joins('tbl_countries','','',$fields);\n\t\tif(empty($countries))\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>array()),REST_Controller::HTTP_INTERNAL_SERVER_ERROR);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$countries));\n\t\t}\n\t}",
"public function getCountries(){\n\t\tglobal $wpdb;\n\n\t\t$query = \"SELECT\n\t\t\t\t\t\t*\n\t\t\t\t\tFROM\n\t\t\t\t\t\t\" . $this->dbPrefix . \"countries\n\t\t\t\t\tORDER BY\n\t\t\t\t\t\tname ASC\";\n\t\treturn $wpdb->get_results($query);\n\t}",
"public function getAll()\n {\n // Declare helper\n $sql = new SQLHelper();\n \n // Prepare query\n $sql->select('*');\n $sql->from('sc_countries');\n $sql->order('name');\n \n // Execute query\n if (! $sql->execute())\n {\n return false;\n }\n \n // Store\n $_countries = array();\n \n // Load\n while ($country = $sql->fetchArray())\n {\n array_push($_countries, $this->assign($country));\n }\n \n // Return\n return $_countries;\n }"
] | [
"0.8582862",
"0.8070363",
"0.8055972",
"0.79445875",
"0.7887289",
"0.78214747",
"0.7797189",
"0.7756252",
"0.7732452",
"0.77305114",
"0.77232754",
"0.7692537",
"0.7672426",
"0.7650709",
"0.76249325",
"0.7604173",
"0.7591132",
"0.75670874",
"0.75670874",
"0.75670874",
"0.75384134",
"0.7525503",
"0.75231504",
"0.75231504",
"0.75162786",
"0.7511779",
"0.74963504",
"0.7482226",
"0.7454235",
"0.74309224"
] | 0.8185789 | 1 |
get all customer state | public function get_state_get()
{
$state = $this->_customer->get_all_state($this->get('countryCode'));
$this->response($state);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_all_customer_details() {\n return $this->db->where(array(\"IS_ACTIVE\" => 1))->get('customer_details')->result_array();\n }",
"public static function all()\n {\n return Configuration::gateway()->customer()->all();\n }",
"public function getAll()\n\t{\n\t\treturn Customer::all();\n\t}",
"public function getAllCustomers(){\n\t\n\t\t$this->allCustomers = $this->customersDAO->getAllCustomers();\n\t}",
"function getAllCustomerInformation($cust_id)\n\n\t{\t\t\t\n\n\t\t$result = $this->db->rawQuery(\"select * from customer where status ='1'\");\n\n\t\treturn $result; \n\n\t}",
"public function getStates();",
"abstract public function getStatesList();",
"public function getAllStates(){\n\t\t$states=$this->usermodel->select_multiple_row('states',['id','name','alias','state_code'],['active'=>1]);\n\t\tif(empty($states)){\n\t\t\t$res['result'] = FALSE;\n\t\t\t$res['message'] = 'No state exist.';\n\t\t\techo json_encode($res);\t\n\t\t\t\n\t\t}else {\n\t\t\t$res['result'] = True;\n\t\t\t$res['data'] = $states;\n\t\t\t$res['message'] = 'All States.';\n\t\t\techo json_encode($res);\t\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function getCustomers() {\n return parent::_requestData('get','customers');\n }",
"public function index()\n {\n return $this->customerService->getAll();\n }",
"function getAllState(){\n\t\n\t \t\tApp::import('model','State');\n\t\t $this->State = new State(); \n\n\t\t\t$StatesList = $this->State->find('list', array('fields' => array('id', 'statename'),'order' => 'State.statename ASC','recursive' => -1,'conditions' => array('State.status' => 'yes'))); \n\t\t\treturn $StatesList;\n\t }",
"function get_all_customer() {\n $this->db->order_by('id', 'desc');\n return $this->db->get('customer')->result_array();\n }",
"public function getAllCustInfo(){\n\t\t\t$sth = mysqli_query($this->con, \"SELECT * FROM customer\");\n\n\t\t\t$rows = array();\n\t\t\twhile($r = mysqli_fetch_assoc($sth)) {\n \t\t\t$rows[] = $r;\n\t\t\t}\n\t\t\treturn $rows;\n\t\t}",
"public function getStates(): array;",
"public function getStates(): array;",
"public function getStates(): array;",
"public function getAllActiveClients(){\n\t\t$db \t\t\t\t= \t\tZend_Db_Table::getDefaultAdapter();\n\t\t$where \t\t\t\t= \t\t$this->_db->quoteInto(\"status=?\",\"t\");\n\t\t$select \t\t\t= \t\t$db->select()\n\t\t\t\t\t\t\t\t\t->from(array('clt' => $this->_name), \"clt.*\")\n\t\t\t\t\t\t\t\t\t->joinLeft(array('ctry' => 'bal_countrycode'),\n\t\t\t\t\t\t\t\t\t\t'ctry.id = clt.country',\n\t\t\t\t\t\t\t\t\t\tarray(\"country\"=>\"ctry.country\"))\n\t\t\t\t\t\t\t\t\t->where($where)\n\t\t\t\t\t\t\t\t\t->order(\"clt.created_date desc\");\n \n\t\t$clientInfo \t\t= \t\t$db->fetchAll($select);\n return $clientInfo;\n\t}",
"public function listNeededStates(): array;",
"function find_all_states() {\n global $db;\n $sql = \"SELECT * FROM states \";\n $sql .= \"ORDER BY name ASC;\";\n $state_result = db_query($db, $sql);\n return $state_result;\n }",
"public function getAllStatesOfMexico()\n\t{\n\t\t$statesServices = new StatesServices();\n\t\t$statesOfMexico = $statesServices->fetchAll();\n\t\t$result = array();\n\t\n\t\tforeach ($statesOfMexico as $s_m){\n\t\t\t//$result[] = ['attributes'=> ['data-est'=>$s_m['id']], 'value' => $s_m['id'], 'label' => $s_m['state'] ];\n\t\t\t$result[$s_m['id']] = $s_m['state'];\n\t\t}\n\t\n\t\treturn $result;\n\t}",
"public static function getStates() {\n try\n {\n $states = User::where('user_type','=',User::IS_BEAUTICIAN)->groupBy('state')->orderBy('state')->select('state','commission_percent')->get();\n static::$data['states'] = $states;\n\n } catch (\\Exception $e) {\n static::setExceptionError($e);\n }\n\n return static::$data;\n }",
"public static function getAllState()\n {\n\n $conn = Connection::getInstance();\n\n $sql = \"select id, name, initials\n from state\";\n\n $rs = $conn->prepare($sql);\n $rs->execute();\n\n $arrayState = array();\n\n while ($row = $rs->fetch(PDO::FETCH_OBJ)) {\n\n $newState = new State($row->id, $row->name, $row->initials);\n array_push($arrayState, $newState->returnArray());\n\n }\n\n return $arrayState;\n\n }",
"function getCustomerData() {\n\t\t$query = \"SELECT * FROM \" . DB_PREFIX . \"customer\";\n\t\t$result = $this->db->query($query);\n\t\treturn $result->rows;\n\t}",
"public function get_active_customers() {\n \t$query = $this->CI->db->where('active',1);\n \t$query->where(\"user_type\",\"customer\");\n \t$query->order_by('company', 'ASC');\n \treturn $query->get($this->collection)->result_array();\n \t\n }",
"public static function actionGetStates(){\n return ArrayHelper::map(States::find()->all(), 'id', 'name');\n }",
"public function listNeededIncomingStates(): array;",
"public function getStatesAndCountries()\n {\n $countries = core()->countries()->toArray();\n $states = core()->groupedStatesByCountries();\n\n return [\n 'countries' => $countries,\n 'states' => $states\n ];\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM customer';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function get_all_Customer_details()\n {\n $query = $this->db->query(\"SELECT A.*, COUNT(B.Customer_Icode) as locations FROM customer_master A LEFT JOIN customer_add_address B on A.Customer_Icode=B.Customer_Icode GROUP By A.Customer_Icode\");\n return $query->result_array();\n }",
"public function getCitiesForState(){\n\t\t\t$citiesInState = array();\n\t\t\t\t\n\t\t\tif ($this->stateExists()){\n\t\t\t\t//Write query\n\t\t\t\t$sqlQuery = \"select distinct c.city_name\n\t\t\t\t\t\t\t from cities c\n\t\t\t\t\t\t\t join states s on c.state_id = s.id\n\t\t\t\t\t\t\t where s.state_name = (ltrim(rtrim(?))) or s.abbreviation = ltrim(rtrim(?)) \n\t\t\t\t\t\t\t \";\n\t\t\t\t//store query parameters\n\t\t\t\t$params = array($this->stateName.\"\", $this->stateName.\"\");\n\t\t\t\t//execute query\n\t\t\t\t$stmt = sqlsrv_query( $this->conn, $sqlQuery, $params);\n\t\t\n\t\t\t\t//Error Occured Executing the SQL Query\n\t\t\t\tif( $stmt === false ) {\n\t\t\t\t\t//Free SQL Statement from Resources\n\t\t\t\t\t\t\n\t\t\t\t\t//Eventually throw an exception\n\t\t\t\t\tdie( print_r( sqlsrv_errors(), true));\n\t\t\n\t\t\t\t}\n\t\t\t\t//SQL Query Executed Fine\n\t\t\t\telse {\n\t\t\t\t\t//Loop Through Result Set\n\t\t\t\t\twhile ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)){\n\t\t\t\t\t\tarray_push($citiesInState, $row['city_name']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t//Return List of States This User Visited\n\t\t\treturn $citiesInState;\n\t\t}"
] | [
"0.7478494",
"0.71439904",
"0.69005835",
"0.68407154",
"0.67664963",
"0.67429596",
"0.66659254",
"0.664759",
"0.66318244",
"0.66049755",
"0.65952045",
"0.65933704",
"0.65755844",
"0.6549223",
"0.6549223",
"0.6549223",
"0.6517104",
"0.6467791",
"0.6449164",
"0.6446381",
"0.6433022",
"0.6403714",
"0.635786",
"0.63449514",
"0.6341628",
"0.6324321",
"0.6323494",
"0.6321482",
"0.63044953",
"0.6252596"
] | 0.75267416 | 0 |
Replace the repository for the given stub. | protected function replaceRepository($stub, $repo)
{
$repo = str_replace('/', '\\', $repo);
$namespaceRepo = $this->laravel->getNamespace().$repo;
if (Str::startsWith($repo, '\\')) {
$stub = str_replace('NamespacedRepository', trim($repo, '\\'), $stub);
} else {
$stub = str_replace('NamespacedRepository', $namespaceRepo, $stub);
}
$stub = str_replace(
"use {$namespaceRepo};\nuse {$namespaceRepo};", "use {$namespaceRepo};", $stub
);
$repo = class_basename(trim($repo, '\\'));
return str_replace('DummyRepo', $repo, $stub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function replaceStub(){\n $dummyModul = $this->dummyModul;\n $DummyModul = ucfirst($dummyModul);\n\n $stub = $this->stub;\n $stub = str_replace('DummyModul', $DummyModul, $stub);\n $stub = str_replace('dummyModul', $dummyModul, $stub);\n if($this->dummyName) $stub = str_replace('dummyName', $this->dummyName, $stub);\n if($this->DummyName) $stub = str_replace('DummyName', $this->DummyName, $stub);\n\n $this->stub = $stub;\n }",
"protected function replaceClass($stub, $name)\n {\n if(!$this->argument('name')){\n throw new InvalidArgumentException(\"Missing required argument repository name\");\n }\n\n $stub = parent::replaceClass($stub, $name);\n\n $stub = str_replace('DummyRepository', $this->repositoryName, $stub);\n $stub = str_replace('DummyModel', $this->modelName, $stub);\n $stub = str_replace('DummyRoute', $this->routeName, $stub);\n\n return $stub;\n }",
"protected function replace(&$stub)\n\t{\n\t\t$stub = str_replace('DummyNamespace', $this->getNamespace(), $stub);\n\n\t\t$stub = str_replace('DummyClass', $this->getClassName(), $stub);\n\t}",
"protected function replaceClass($stub, $name)\n {\n if(!$this->argument('name')){\n throw new InvalidArgumentException(\"Missing required argument repository name\");\n }\n\n $stub = parent::replaceClass($stub, $name);\n\n return str_replace('DummyRepository', $this->argument('name'), $stub);\n }",
"public function setRepository($rep)\n {\n $this->repository = $rep;\n\n }",
"protected function getStub()\n {\n return __DIR__.'/stubs/Repository.stub';\n }",
"private function setFakeRepository()\n {\n if(!is_object($this->repository)) {\n $repository = new PublicRepository();\n $repository->entity_type = 'FakeEntity';\n $repository->entity_id = 777;\n $repository->path = ModelRepositories::buildPath(\n $repository->entity_type, $repository->entity_id, $repository->visibility\n );\n $this->repository = $repository;\n }\n }",
"protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }",
"private function setStub()\n {\n if ($this->stub)\n {\n // Minify and set.\n $stub = PharBuilder::minifyPhp($this->stub);\n $this->phar->setStub($stub);\n }\n else\n {\n // No stub.\n $this->phar->setStub('');\n }\n }",
"protected function replaceClass($stub, $name)\n {\n if(!$this->argument('name')){\n throw new InvalidArgumentException(\"Missing required argument repository name\");\n }\n\n $stub = parent::replaceClass($stub, $name);\n\n $stub = str_replace('DummyModel', $this->modelName, $stub);\n $stub = str_replace('DummyAct', $this->actName, $stub);\n $stub = str_replace('DummyResource', $this->resourceName, $stub);\n\n $loop = $this->getReplaceLoop($stub);\n $stub = str_replace('DummyLoop,', $loop, $stub);\n\n\n return $stub;\n }",
"public function setRepository(RepositoryInterface $repository): void;",
"protected function getStub()\n {\n return __DIR__.'/stubs/repository-interface.stub';\n }",
"function setREPO($repo) { /* {{{ */\n\t\t$this->_repo = $repo;\n\t}",
"protected function replaceNamespace(&$stub, $name)\n {\n $stub = str_replace(\n [\n 'DummyTestNamespace',\n 'DummyRootNamespace',\n 'NamespacedDummyModel',\n 'DummyPluralClass',\n 'DummyModuleNamespace',\n 'dummyResourceKey',\n 'dummyTableName',\n 'dummyRepository',\n 'dummyModel',\n 'dummyPluralModel',\n 'dummySnakeModel',\n 'dummyPluralSnakeModel',\n 'DUMMY_TABLE_NAME'\n ],\n [\n $this->getNamespace($name),\n $this->rootNamespace(),\n Str::replaceFirst($this->rootNamespace() . '\\Unit', 'App\\Modules', $this->getNamespacedModel($name)),\n str_plural($this->getClassName($name)),\n Str::replaceFirst($this->rootNamespace() . '\\Unit', 'App\\Modules', parent::getNamespace($name)),\n $this->getTableName(),\n $this->getTableName(),\n Str::camel($this->getClassName($name)) . 'Repository',\n Str::camel($this->getClassName($name)),\n str_plural(Str::camel($this->getClassName($name))),\n Str::snake($this->getClassName($name)),\n str_plural(Str::snake($this->getClassName($name))),\n strtoupper(str_plural(Str::snake($this->getClassName($name))) . '_table')\n ],\n $stub\n );\n\n return $this;\n }",
"protected function replaceNamespace(&$stub, $name)\n {\n $searches = [\n ['DummyNamespace' , 'DummyRootNamespace' , 'NamespacedDummyUserModel' , '{{name}}' ,'{{prefix}}'],\n ['{{ namespace }}' , '{{ rootNamespace }}' , '{{ namespacedUserModel }}' , '{{ModelName}}' ,'{{prefixName}}'],\n ['{{namespace}}' , '{{rootNamespace}}' , '{{namespacedUserModel}}' , '{{ name }}' ,'{{ prefix }}'],\n ];\n\n foreach ($searches as $search) {\n $stub = str_replace(\n $search,\n [$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel(), $this->getNameInput(),$this->getPrefix()],\n $stub,\n );\n }\n\n return $this;\n }",
"protected function replaceClass($stub, $name)\n {\n if(!$this->argument('name')){\n throw new InvalidArgumentException(\"Missing required argument repository name\");\n }\n\n $stub = parent::replaceClass($stub, $name);\n\n $interface = $this->option('interface');\n\n $stub = str_replace('DummyInterface', $interface, $stub);\n\n return str_replace('DummyService', $this->argument('name'), $stub);\n }",
"protected function replacePackageName(&$stub, $packageName)\n {\n $stub = str_replace('{{packageName}}', $packageName, $stub);\n\n return $this;\n }",
"abstract protected function replaceNamespace(string $stub): string;",
"private function replaceArchive(&$stub, $archive)\n {\n if ($archive) {\n $stub = str_replace(\n \"DummyArchiveUse\", \"use Illuminate\\\\Database\\\\Eloquent\\\\SoftDeletes;\\n\", $stub\n );\n\n $stub = str_replace(\n \"DummyArchive\", \"use SoftDeletes;\", $stub\n );\n\n return $this;\n }\n\n $stub = str_replace(\n \"DummyArchiveUse\", \"\", $stub\n );\n\n $stub = str_replace(\n \"DummyArchive\", \"\", $stub\n );\n\n return $this;\n\n }",
"protected function replaceInterfaceStubs($stub) : string\n {\n $namespace = $this->getInterfaceNamespace($this->className);\n\n $alias = $this->className.$this->suffix;\n\n $stub = str_replace('DummyInterfaceNamespace', \"$namespace as $alias\", $stub);\n\n $stub = str_replace('DummyInterface', $alias, $stub);\n\n return $stub;\n }",
"protected function replaceClass($stub, $name)\n {\n $stub = parent::replaceClass($stub, $name);\n $stub = str_replace('Type', $this->repositoryType, $stub);\n\n return str_replace('Dummy', $this->model, $stub);\n }",
"protected function replaceNamespace(&$stub, $name)\n {\n \n $bladename = strtolower(str_replace(\"\\\\\", \".\", str_replace($this->rootNamespace().\"\\\\\", \"printables.\", $name)));\n\n $stub = str_replace(\n ['DummyNamespace', 'DummyRootNamespace', 'NamespacedDummyUserModel', 'DummyBladeName'],\n [$this->getNamespace($name), $this->rootNamespace(), $this->userProviderModel()],\n $stub\n );\n\n return $this;\n }",
"protected function swapRepository($contract, array $models = [])\n {\n app()->instance($contract, $this->fakeRepository($models));\n\n return $this;\n }",
"protected function replaceNamespace(&$stub, $name)\n {\n $stub = str_replace(\n 'DummyNamespace', $this->getNamespace($name), $stub\n );\n $stub = str_replace(\n 'DummyRootNamespace', $this->laravel->getNamespace(), $stub\n );\n if (method_exists($this, 'replaceParameters')) {\n $this->replaceParameters($stub);\n }\n return $this;\n }",
"protected function replaceNamespace(string $stub): string\n {\n return $stub;\n }",
"private function replaceTable(&$stub, $table)\n {\n $stub = str_replace(\n 'DummyTable', $table, $stub\n );\n\n return $this;\n }",
"protected function getInterfaceStub() {\n return __DIR__ . '/stubs/repository.interface.stub';\n }",
"protected function registerRepoInterface() {\n\t\t$this->app['snowman.repointerface'] = $this->app->share(function($app) {\n\t\t\t$generator = $this->app->make('Yhbyun\\Snowman\\Generator');\n\n\t\t\treturn new RepoInterfaceGeneratorCommand($generator);\n\t\t});\n\n\t\t$this->commands('snowman.repointerface');\n\t}",
"protected function replaceNamespace(&$stub, $name)\n {\n $stub = str_replace(\n 'DummyNamespace', $this->getFileNamespace(), $stub\n );\n\n $stub = str_replace(\n 'DummyRootNamespace', $this->getGivenNamespace(), $stub\n );\n \n return $this;\n }",
"protected function getStub()\n {\n return app_path() .'/Console/Commands/Stubs/repository.stub';\n }"
] | [
"0.6642846",
"0.6068871",
"0.6038406",
"0.57947516",
"0.57789624",
"0.5741326",
"0.5728998",
"0.5715511",
"0.5671448",
"0.5663213",
"0.56614244",
"0.5631181",
"0.562332",
"0.55492544",
"0.5534196",
"0.55121803",
"0.54867274",
"0.5467944",
"0.54399574",
"0.54117626",
"0.5383041",
"0.53628874",
"0.52531683",
"0.5250396",
"0.5244851",
"0.52372336",
"0.5182371",
"0.5177064",
"0.51510775",
"0.5144037"
] | 0.67410445 | 0 |
Install the TwoStream package | public function install()
{
$disk = Storage::createLocalDriver([
'driver' => 'local',
'root' => app_path(),
]);
$this->info('Publishing required files', 1);
$this->call('vendor:publish', ['--provider' => strtolower(TwoStream::PACKAGE), '--tag' => 'required'], 2);
$this->info('Applying your app\'s namespace <comment>[' . $this->appNamespace . ']</comment>', 1);
foreach (TwoStreamServiceProvider::pathsToPublish(strtolower(TwoStream::PACKAGE), 'required') as $required) {
$required = str_replace(app_path(), '', $required);
$originalFile = $disk->get($required);
$file = str_replace('{{namespace}}', $this->appNamespace, $originalFile);
if ($file != $originalFile) {
$this->info('Setting namespace for <comment>[/app' . str_replace([app_path(), '.php', '.stub'], '', $required) . ']</comment>', 2);
$disk->put($required, $file);
if (!$disk->exists(str_replace('.stub', '.php', $required)))
$disk->move($required, str_replace('.stub', '.php', $required));
}
}
$this->info('Cleaning up...', 1);
$files = $disk->allFiles('Ws');
foreach ($files as $key => $file) {
if (preg_match('/\\.stub$/', $file))
$disk->delete($file);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function install() {}",
"public static function install();",
"public function install() {}",
"public function install();",
"public function install();",
"public function install();",
"public function install();",
"public function install() { }",
"function install () {\r\n\r\n }",
"public function install() {\n \n }",
"public static function install(){\n\t}",
"function install()\n {\n }",
"public function install()\n {\n // leave this empty\n }",
"function install () {\t\n\t}",
"static function install() {\n\n\t\t\tVWliveStreaming::channel_post();\n\t\t\tflush_rewrite_rules();\n\t\t}",
"static function install()\n {\n }",
"public function install()\n\t{\n\t}",
"function stocktwits_install() {\n}",
"abstract public static function install();",
"abstract public function install();",
"abstract public function install();",
"public function install () {\n\t\t$this->_log_version_number();\n\t}",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public function install() {\n\t\t$this->_log_version_number();\n\t}",
"public static function install()\r\n {\r\n add_option(self::OPTION_VERSION, self::VERSION);\r\n }",
"public static function install(): void\n {\n static::updateSassFrontend(); \n static::updateBootstrapping();\n static::updateWelcomePage();\n }",
"public function install() {\n $this->_log_version_number();\n }",
"public function install()\n {\n $command = 'install';\n $this->run($command);\n }",
"public function install()\n {\n $this->_log_version_number();\n }"
] | [
"0.6079185",
"0.5936719",
"0.5924882",
"0.5841871",
"0.5841871",
"0.5841871",
"0.5841871",
"0.5749156",
"0.57223487",
"0.5686485",
"0.5615641",
"0.5589563",
"0.55530626",
"0.55265963",
"0.5420471",
"0.53827214",
"0.53791845",
"0.53480667",
"0.533975",
"0.5320446",
"0.5320446",
"0.5275482",
"0.52681243",
"0.52681243",
"0.52681243",
"0.5197007",
"0.5141142",
"0.512908",
"0.5122803",
"0.51085997"
] | 0.6080346 | 0 |
showGravatar() Get either a Gravatar URL or complete image tag for a specified email address. | public function showGravatar($email, $s = 100, $d = 'mm', $r = 'g', $img = false, $atts = array()) {
if (!empty($email)) {
$url = 'http://www.gravatar.com/avatar/';
$url .= md5(strtolower(trim($email)));
$url .= "?s={$s}&d={$d}&r={$r}";
if ($img) {
$url = "<img src=\"{$url}\"";
foreach ($atts as $key => $val)
$url .= " {$key}=\"{$val}\"";
$url .= " />";
}
return $url;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getGravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n\t$url = 'https://www.gravatar.com/avatar/';\n\t$url .= md5( strtolower( trim( $email ) ) );\n\t$url .= \"?s=$s&d=$d&r=$r\";\n\tif ( $img ) {\n\t\t$url = '<img src=\"' . $url . '\"';\n\t\tforeach ( $atts as $key => $val )\n\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\n\t\t$url .= ' />';\n\t}\n\treturn $url;\n}",
"function getGravatar($aEmail, $aImage = false, $aSize = 60, $aDefault = 'monsterid') {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5(trim(strtolower($aEmail)));\n $url .= \"?s={$aSize}&d={$aDefault}\";\n if ($aImage) {\n $url = \"<img src='{$url}' alt='Gravatar'>\";\n }\n return $url;\n }",
"public function getGravatar(){\n\t\t$SiteConfig = SiteConfig::current_site_config();\n\t\tif($SiteConfig->DefaultGravatarImageID != 0){\n\t\t\t$default = urlencode(Director::absoluteBaseURL().$SiteConfig->DefaultGravatarImage()->Link());\n\t\t}\n\t\telseif($SiteConfig->DefaultGravatar != ''){\n\t\t\t$default = urlencode($SiteConfig->DefaultGravatar);\n\t\t}\n\t\telse{\n\t\t\t$default = '';\n\t\t}\n\t\tif($SiteConfig->GravatarSize){\n\t\t\t$GravatarSize = $SiteConfig->GravatarSize;\n\t\t}\n\t\telse{\n\t\t\t$GravatarSize = '32';\n\t\t}\n\t\t$link = 'http://www.gravatar.com/avatar/$MD5Email?default='.$default.'&s='.$GravatarSize;\n\t\treturn $link;\n\t}",
"public function gravatar()\n\t{\n\t\t// Generate the Gravatar hash\n\t\t$gravatar = md5(strtolower(trim($this->gravatar)));\n\n\t\t// Return the Gravatar url\n\t\treturn \"//gravatar.org/avatar/{$gravatar}\";\n\t}",
"public function gravatar()\n\t{\n\t\t// Generate the Gravatar hash\n\t\t$gravatar = md5(strtolower(trim($this->gravatar)));\n\n\t\t// Return the Gravatar url\n\t\treturn \"//gravatar.org/avatar/{$gravatar}\";\n\t}",
"protected function getGravatar( $email, $s = 15, $d = 'identicon', $r = 'g', $img = true, $atts = array(\"title\"=>\"To update click here!\") ) \r\n\t{\r\n\t\t$url = 'http://www.gravatar.com/avatar/';\r\n\t\t$url .= md5( strtolower( trim( $email ) ) );\r\n\t\t$url .= \"?s=$s&d=$d&r=$r\";\r\n\t\tif ( $img ) {\r\n\t\t\t$url = '<img src=\"' . $url . '\"';\r\n\t\t\tforeach ( $atts as $key => $val )\r\n\t\t\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\r\n\t\t\t$url .= ' />';\r\n\t\t}\r\n\t\treturn $url;\r\n\t}",
"public static function getGravatarUrl($email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array()) {\n $url = 'https://www.gravatar.com/avatar/';\n $url .= md5(strtolower(trim($email)));\n $url .= \"?s=$s&d=$d&r=$r\";\n if ($img) {\n $url = '<img src=\"' . $url . '\"';\n foreach ($atts as $key => $val) {\n $url .= ' ' . $key . '=\"' . $val . '\"';\n }\n $url .= ' />';\n }\n return $url;\n }",
"public function getGravatar() {\n\t\t// Return the current\n\t\t// gravatar URL\n\t\treturn $this->sGravatar;\n\t}",
"public function gravatar($email)\n\t{\n\t\treturn \"http://www.gravatar.com/avatar/\" . md5( strtolower( trim( $email ) ) ) . \"?d=\" . urlencode(self::$config['default_avatar']) . \"&s=100\";\n\t}",
"public function gravatarAction()\n {\n $this->verifyaccess();\n $gravatar = $this->getGravatar();\n return $this->render(\n 'XvolutionsAdminBundle:template:gravatar.html.twig', array(\n 'gravatar' => $gravatar\n )\n );\n }",
"function gravatar_img($email, $size = null, $rating = null, $default = 'mm')\r\n{\r\n return '<img src=\"'.gravatar($email, $size, $rating, $default).'\" alt=\"Gravatar\" />';\r\n}",
"function get_gravatar( $email, $s = 200, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\r\n\t\t$url = 'https://www.gravatar.com/avatar/';\r\n\t\t$url .= md5( strtolower( trim( $email ) ) );\r\n\t\t$url .= \"?s=$s&d=$d&r=$r\";\r\n\t\tif ( $img ) {\r\n\t\t\t$url = '<img src=\"' . $url . '\"';\r\n\t\t\tforeach ( $atts as $key => $val )\r\n\t\t\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\r\n\t\t\t$url .= ' />';\r\n\t\t}\r\n\t\treturn $url;\r\n\t}",
"function get_gravatar($email = null, $s = 50, $d = 'mm', $r = 'g', $img = true, $atts = array() ) {\n\t\treturn get_avatar($email, $s, null, false);\n\t}",
"function kleo_fb_bp_show_avatar_url($gravatar, $params) {\n\tif(strpos($gravatar, home_url()) !== FALSE && strpos($gravatar, 'gravatar') === FALSE) return $gravatar;\n\t\n $pic = get_user_meta($params['item_id'], 'kleo_fb_picture', true);\n if (!$pic || $pic == '') return $gravatar;\n\treturn $pic . apply_filters('fb_show_avatar_params', '?width=580&height=580');\n}",
"function get_gravatar( $email, $s = 40, $d = 'mm', $r = 'g', $img = false) {\n $url = 'https://www.gravatar.com/avatar/';\n $url .= strtolower(md5( strtolower( trim( $email ) ) ));\n\n $url .= \"?s=$s&r=$r\";\n if ( $img ) {\n $url = '<img src=\"' . $url . '\"';\n foreach ( $atts as $key => $val )\n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n return $url;\n }",
"function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n\t$url = 'http://www.gravatar.com/avatar/';\n\t$url .= md5( strtolower( trim( $email ) ) );\n\t$url .= \"?s=$s&d=$d&r=$r\";\n\tif ( $img ) {\n\t\t$url = '<img src=\"' . $url . '\"';\n\t\tforeach ( $atts as $key => $val )\n\t\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\n\t\t$url .= ' />';\n\t}\n\treturn $url;\n}",
"function get_gravatar( $email, $s = 80, $d = 'http%3A%2F%2Fjoketi.me%2Fres%2Fdef_avatar.png', $r = 'r', $img = false, $atts = array() ) {\n\t$url = 'http://www.gravatar.com/avatar/';\n\t$url .= md5( strtolower( trim( $email ) ) );\n\t$url .= \"?s=$s&d=$d&r=$r\";\n\tif ( $img ) {\n\t\t$url = '<img src=\"' . $url . '\"';\n\t\tforeach ( $atts as $key => $val )\n\t\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\n\t\t$url .= ' />';\n\t}\n\treturn $url;\n}",
"function fluentcrmGravatar($email)\n{\n $hash = md5(strtolower(trim($email)));\n return apply_filters(\n FLUENTCRM . '_get_avatar',\n \"https://www.gravatar.com/avatar/${hash}?s=128\",\n $email\n );\n}",
"function satb_get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5( strtolower( trim( $email ) ) );\n $url .= \"?s=$s&d=$d&r=$r\";\n if ( $img ) {\n $url = '<img src=\"' . $url . '\"';\n foreach ( $atts as $key => $val )\n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n return $url;\n}",
"function get_gravatar( $email, $defaultImage, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5( strtolower( trim( $email ) ) );\n $url .= \"?s=$s&d=$d&r=$r\";\n\n if ($img) {\n $url = '<img src=\"' . $url . '\"';\n foreach ( $atts as $key => $val ) \n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n\n $isImageResult = is_gravatar_image($url);\n //echo $isImageResult;\n\n if ($isImageResult == 'true') {\n\t\treturn $url;\n\t} else {\n\t\treturn $defaultImage;\n\t}\n}",
"public function getGravatarAttribute() {\n\n $hash = md5(strtolower(trim($this->attributes['email'])));\n\n return \"http://www.gravatar.com/avatar/$hash\";\n }",
"protected function getGravatar($email, $s = 80, $d = 'identicon', $r = 'g')\n {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5(strtolower(trim($email)));\n $url .= \"?s=$s&d=$d&r=$r\";\n\n return $url;\n }",
"function get_gravatar($email, $size = 80, $default = 'identicon', $rating = 'g', $img = false, $attr = array())\n {\n $url = 'https://www.gravatar.com/avatar/';\n $url .= md5(strtolower(trim($email)));\n $url .= \"?s=$size&d=$default&r=$rating\";\n if ($img) {\n $url = '<img src=\"'.$url.'\"';\n foreach ($attr as $key => $val) {\n $url .= ' '.$key.'=\"'.$val.'\"';\n }\n $url .= ' />';\n }\n\n return $url;\n }",
"public function get_gravatar($email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array()) {\n $url = 'http://www.gravatar.com/avatar/';\n $url .= md5(strtolower(trim($email)));\n $url .= \"?s=$s&d=$d&r=$r\";\n if ($img) {\n $url = '<img src=\"' . $url . '\"';\n foreach ($atts as $key => $val)\n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n return $url;\n }",
"private function generateGravatarUrl(): string\n {\n $account = Account::findByChar($this);\n\n if (OFFLINE) {\n return IMAGE_ROOT.'default_avatar.png';\n } elseif (!$this->vo || !$this->vo->avatar_type || !$account || !$account->email()) {\n return '';\n } else {\n $email = $account->email();\n\n $def = 'monsterid'; // Default image or image class.\n // other options: wavatar (polygonal creature) , monsterid, identicon (random shape)\n $base = \"https://www.gravatar.com/avatar/\";\n $hash = md5(trim(strtolower($email)));\n $no_gravatar = \"d=\".urlencode($def);\n $size = 80;\n $rating = \"r=x\";\n $res = $base.$hash.\"?\".implode('&', [$no_gravatar, $size, $rating]);\n\n return $res;\n }\n }",
"public function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n\t\t$url = 'http://www.gravatar.com/avatar/';\n\t\t$url .= md5( strtolower( trim( $email ) ) );\n\t\t$url .= \"?s=$s&d=$d&r=$r\";\n\t\tif ( $img ) {\n\t\t\t$url = '<img src=\"' . $url . '\"';\n\t\t\tforeach ( $atts as $key => $val )\n\t\t\t\t$url .= ' ' . $key . '=\"' . $val . '\"';\n\t\t\t$url .= ' />';\n\t\t}\n\t\treturn $url;\n\t}",
"private static function get_gravatar( $email, $s = 80, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {\n $url = 'https://cn.gravatar.com/avatar/';\n $url .= md5( strtolower( trim( $email ) ) );\n $url .= \"?s=$s&d=$d&r=$r\";\n if ( $img ) {\n $url = '<img src=\"' . $url . '\"';\n foreach ( $atts as $key => $val )\n $url .= ' ' . $key . '=\"' . $val . '\"';\n $url .= ' />';\n }\n return $url;\n }",
"public function getGravatar($email = null, $sss = 80, $ddd = 'mm', $rrr = 'g', $img = false, $atts = array())\n {\n $email = $email ?? $this->email;\n $url = 'https://www.gravatar.com/avatar/';\n $url .= md5(strtolower(trim($email)));\n $url .= \"?s=$sss&d=$ddd&r=$rrr\";\n if ($img) {\n $url = '<img src=\"' . $url . '\"';\n foreach ($atts as $key => $val) {\n $url .= ' ' . $key . '=\"' . $val . '\"';\n }\n $url .= ' />';\n }\n return $url;\n }",
"public function getGravatar($email = null)\n\t{\n\t\tif (isset($email)) {\n\t\t\t$this->setEmail((string) $email);\n\t\t}\n\n\t\t$url = self::BASEURL;\n\t\tif ($this->secure) {\n\t\t\t$url = self::BASEURL_SECURE;\n\t\t}\n\n\t\t$url .= $this->email;\n\t\t$url .= $this->extension;\n\t\t$url .= '?s=' . $this->size;\n\t\t$url .= '&d=' . $this->default;\n\n\t\tif ($this->forceDefault) {\n\t\t\t$url .= '&forcedefault=y';\n\t\t}\n\n\t\t$url .= '&rating=' . $this->rating;\n\n\t\treturn $url;\n\t}",
"public static function getGravatar($email, $rating = 'g', $imageset = 'mm', $size = 80) {\n\t\tif(!in_array($rating, array('g', 'pg', 'r', 'x'), true)) $rating = 'g';\n\t\tif(empty($imageset)) $imageset = 'mm';\n\t\t$size = (int) $size; \n\t\t$http = wire('config')->https ? 'https' : 'http';\n\t\t$url = \t\"$http://www.gravatar.com/avatar/\" . \n\t\t\tmd5(strtolower(trim($email))) . \n\t\t\t\"?s=$size\" . \n\t\t\t\"&d=\" . htmlentities($imageset) . \n\t\t\t\"&r=$rating\";\n\t\treturn $url;\t\n\t}"
] | [
"0.7907102",
"0.7803086",
"0.7740388",
"0.7703294",
"0.7703294",
"0.76527464",
"0.75500727",
"0.7532211",
"0.752186",
"0.7514712",
"0.7503005",
"0.74670124",
"0.74425256",
"0.740001",
"0.73907393",
"0.7386396",
"0.7348347",
"0.73454624",
"0.73381233",
"0.7325198",
"0.7302203",
"0.7298163",
"0.72805244",
"0.7269516",
"0.7267975",
"0.72327423",
"0.7212899",
"0.72081864",
"0.7170033",
"0.7168543"
] | 0.8180437 | 0 |
showIP() This function get real ip address | public function showIP() {
if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0) {
$addr = explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']);
return trim($addr[0]);
} else {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
} else {
return $_SERVER['REMOTE_ADDR'];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIP(): string;",
"public function getIp() : string ;",
"protected function get_ip() : string\n\t{\n\t\treturn ci('input')->ip_address();\n\t}",
"public function getIP(): string\n {\n return $this->ip;\n }",
"private function getIpAddress(): string\n {\n $remoteAddress = $_SERVER['REMOTE_ADDR'] ?? '';\n\n return preg_replace(self::IP_REGEX, '$1x', $remoteAddress);\n }",
"function ip()\n{/*{{{*/\n $request = _request();\n\n if ($request->header['x-real-ip']) {\n $ip = $request->header['x-real-ip'];\n } else {\n $ip = 'unknown';\n }\n\n return preg_replace('/^[^0-9]*?(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}).*$/', '\\1', $ip);\n}",
"public function getIPAddress(): string;",
"public function getIpAddress()\n\t\t{\n\t\t}",
"public function getIp(): string\n {\n return $this->ip;\n }",
"public function getRealClientIP(): string;",
"public function getIpAddress()\n {\n $ip = $this->getIpAddressFromProxy();\n if ($ip) {\n return $ip;\n }\n\n // direct IP address\n if (isset($_SERVER['REMOTE_ADDR'])) {\n return $_SERVER['REMOTE_ADDR'];\n }\n return '';\n }",
"private function getPublicIp()\n {\n $externalContent = file_get_contents('http://checkip.dyndns.com/');\n preg_match('/Current IP Address: ([\\[\\]:.[0-9a-fA-F]+)</', $externalContent, $m);\n return $m[1];\n }",
"public function getIP() {\n\t\treturn $this->strIP;\n\t}",
"public function getClientIP(): string;",
"public static function get_external_ip() {\n\t}",
"public function ip(){\n\t\treturn $this->server['REMOTE_ADDR'];\n\t}",
"public function getIpAddress(): string;",
"public function getIp(): string\n\t{\n\t\treturn $this->ip;\n\t}",
"protected function get_ip() {\n\t\tif (empty($_SERVER['REMOTE_ADDR'])) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $this->normalize_ip($_SERVER['REMOTE_ADDR']);\n\t}",
"public function getIPAddress()\n {\n return isset($this->I_p_address) ? $this->I_p_address : '';\n }",
"public function getIpAddress(): string\n {\n return $this->data[self::FIELD_IP_ADDRESS];\n }",
"public function getUserIP(): string\n {\n return $this->serverData['REMOTE_ADDR'];\n }",
"public function getIP()\n\t{\t \n\t \treturn $this->IP;\n\t}",
"public function getIp()\n {\n return (string) $this->ip;\n }",
"public static function getIp() {\n\t return isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : '0.0.0.0';\n\t}",
"public function getIP($forDisplay = FALSE)\r\n\t{\r\n\t\tif ($forDisplay == FALSE) return $this->ourIP;\r\n\t\treturn $this->ipDecode($this->ourIP);\r\n\t}",
"function get_ip() {\n return $this->ip;\n }",
"public function ip(?string $address=null): string\n { // NOTE: this could be quite a lot of changes in various aspects of the system that might be storing that ip address and using it locally\n $this->cli->debug(\"new ip address = '$address'\");\n\n $list = $this->dnsService->listIpAddress();\n\n return implode(\"\\n\", $list);\n }",
"public static function ipAddress(): string\n {\n return Arr::key($_SERVER, 'HTTP_CLIENT_IP',\n Arr::key($_SERVER, 'HTTP_X_FORWARDED_FOR', $_SERVER['REMOTE_ADDR']));\n }",
"function sm_myip()\r\n\t{\r\n\t\treturn trim(file_get_contents(\"https://api.ipify.org\"));\r\n\t}"
] | [
"0.75564915",
"0.7528237",
"0.74070513",
"0.7204806",
"0.7154267",
"0.71330065",
"0.7128043",
"0.7119811",
"0.7065944",
"0.70535237",
"0.70504916",
"0.70358163",
"0.7035751",
"0.6998305",
"0.6989926",
"0.69854105",
"0.6939633",
"0.69387585",
"0.6933824",
"0.691835",
"0.6918065",
"0.6913457",
"0.68957585",
"0.68800604",
"0.6822924",
"0.6816879",
"0.68081045",
"0.68015677",
"0.6795997",
"0.6792505"
] | 0.8159803 | 0 |
pre_dump() This method is a simply pretty dump. | public function pre_dump($dump) {
echo '<pre>';
var_dump($dump);
echo '</pre>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _dump($input, $pre=true){\n\t\tif($pre) echo '<pre>';\n\t\tvar_dump($input);\n\t\tif($pre) echo '</pre>';\n\t}",
"public function debug_dump()\n {\n \n }",
"public function dump();",
"private function dump()\n {\n dump($this->parents);\n dump($this->children);\n dump($this->slugs);\n\n dump($this->recordRoutes);\n dump($this->listingRoutes);\n dump($this->contenttypeRules);\n }",
"public function dump()\n {\n \n }",
"function dumpDebug(){\n\t\t$this->oDebug->dumpDebug();\n\t}",
"function _pre() {}",
"public function isDump()\n {\n return false;\n }",
"protected function _pre() { }",
"public function var_dump_pre() {\n echo '<pre>';\n var_dump($this->array_4d_result );\n echo '</pre>';\n return null;\n }",
"function dump()\n{\n if (!dumpEnabled()) return false;\n $args = func_get_args();\n __printCallSource();\n echo '';\n foreach ($args as $i => $obj) {\n if ($i) print \"\\n\";\n print mdump($obj);\n }\n echo '';\n}",
"function conditionaldump() {\r\n\t\t\t$args = func_get_args();\r\n\t\t\tif (array_shift($args)) {\r\n\t\t\t\tPDebug::doOutput(PDebug::dump($args));\r\n\t\t\t\tPDebug::flush();\r\n\t\t\t}\r\n\t\t}",
"public function handlesDumpCompression();",
"public function Dump()\n {\n }",
"public static function dump()\n {\n $this->objList();\n $this->includeList();\n }",
"function dump(){\r\r\n\t\t// that are currently defined in the instance of the class using the\r\r\n\t\t// add_field() function.\r\r\n\t\tksort($this->fields);\r\r\n\t\techo '<h2>ppal->dump() Output:</h2>' . \"\\n\";\r\r\n\t\techo '<code style=\"font: 12px Monaco, \\'Courier New\\', Verdana, Sans-serif; background: #f9f9f9; border: 1px solid #D0D0D0; color: #002166; display: block; margin: 14px 0; padding: 12px 10px;\">' . \"\\n\";\r\r\n\t\tforeach ($this->fields as $key => $value) echo '<strong>'. $key .'</strong>:\t'. urldecode($value) .'<br/>';\r\r\n\t\techo \"</code>\\n\";\r\r\n\t}",
"public static function dump()\n\t{\n\t\techo self::HTML_START . PHP_EOL;\n\t\t$args = func_get_args();\n\t\tforeach($args as $arg) {\n\t\t\tif(self::$useXDebug) {\n\t\t\t\tvar_dump($arg);\t\n\t\t\t} else {\n\t\t\t\tob_start();\n\t\t\t\tvar_dump($arg);\n\t\t\t\t$rawDump = ob_get_clean();\n\t\t\t\t$lines = explode(PHP_EOL, $rawDump);\n\t\t\t\techo '<pre>';\n\t\t\t\tforeach($lines as $line) {\n\t\t\t\t\techo htmlspecialchars($line) . '<br>' . PHP_EOL;\n\t\t\t\t}\n\t\t\t\techo '</pre>';\n\t\t\t}\n\t\t}\n\t\techo self::HTML_END . PHP_EOL;\n\t}",
"function var_dump_pre($tab)\n{\n echo '<pre>';\n var_dump($tab);\n echo '</pre>';\n}",
"public function printDump()\n {\n return null;\n }",
"private function dumpPreamble(SqlDumperContext $context) {\n $dumpOutput = $context->getDumpOutput();\n\n $commentStart = $context->getConnectionHandler()->getPlatform()->getSqlCommentStartString();\n $dumpOutput->writeln($commentStart . ' ------------------------');\n $dumpOutput->writeln($commentStart . ' SnakeDumper SQL Dump');\n $dumpOutput->writeln($commentStart . ' ------------------------');\n $dumpOutput->writeln('');\n\n $extras = $context->getConnectionHandler()->getPlatformAdjustment()->getPreembleExtras();\n foreach ($extras as $extra) {\n $dumpOutput->writeln($extra);\n }\n\n $dumpOutput->writeln('');\n }",
"public function data_dump() {\n\t\tvar_dump($this->customizerData);\n\t}",
"public function dump() {\n print_r($this->data);\n }",
"public function dump() {\n print_r($this->data);\n }",
"function ddump()\n{\n if (!dumpEnabled()) return false;\n $args = func_get_args();\n call_user_func_array('dump', $args);\n die;\n}",
"public function dump() {\n echo \"<p>-----------------------<br />\" . PHP_EOL;\n //print_r($this->params);\n print_r($this);\n echo PHP_EOL . \"<br />-----------------------</p>\" . PHP_EOL;\n }",
"public function getDumpString();",
"function pre_var_dump( $data, $label = '' ) {\n echo '<div style=\"background-color: #f2f2f2; padding: 12px;\">';\n\n if ( ! empty( $label ) ) {\n echo '<h3>' . $label . '</h3>';\n }\n\n echo '<pre>';\n var_dump( $data );\n echo '</pre>';\n\n echo '</div>';\n\n return;\n}",
"function _pre() \n{\n\tif (is_dev()) // display these debug messages only to developers\n\t{\n\t\t$argumets = func_get_args(); // get the arguments passed to this function\n\t\tforeach ($argumets as $key=>$var) \n\t\t{\n\t\t\techo \"\\n\".'<pre style=\"border:1px dotted red; color:#000;background:#fff;font:12px monospace;text-align:left\">'.\"\\n\";\n\t\t\tprint_r($var); // display any type of variable\n\t\t\techo \"\\n\".'</pre>'.\"\\n\";\n\t\t}\n\t}\n}",
"function spyc_dump($data)\n {\n return Spyc::YAMLDump($data, false, false, true);\n }",
"function dump_all() {\n\t\techo \"-----------------------------<br />\";\n\t\t$this -> dump_tree();\n\t\t$this -> dump_jail();\n\t\techo \"-----------------------------<br />\";\n\t}"
] | [
"0.72038823",
"0.7076923",
"0.6811846",
"0.66760945",
"0.6596627",
"0.6384686",
"0.63729495",
"0.63379985",
"0.63227564",
"0.63049984",
"0.6298706",
"0.6286808",
"0.62609744",
"0.62479997",
"0.62429273",
"0.6169809",
"0.6153823",
"0.6142628",
"0.6117819",
"0.61088866",
"0.6073037",
"0.6064914",
"0.6064914",
"0.6025844",
"0.6008251",
"0.5956878",
"0.5932629",
"0.59296215",
"0.59040207",
"0.58996403"
] | 0.82649803 | 0 |
// |route: /api/filter/prospect |postdata: | property_value_min; property_value_max; | ltv_min; ltv_max; | loan_age_min; loan_age_max; | income_min; income_max; | property_owned_min; property_owned_max; | age_min; age_max; | assets_min; assets_max; | debt_min; debt_max; | certainty; | sector; | public function filterProspectAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$user = $this->get('security.context')->getToken()->getUser();
$userId = $user->getId();
$postdata = $request->query->all();
if (!isset($postdata['property_value_min'])) $postdata['property_value_min'] = 0;
if (!isset($postdata['property_value_max'])) $postdata['property_value_max'] = 10000000; //10000000;
if (!isset($postdata['ltv_min'])) $postdata['ltv_min'] = 0;
if (!isset($postdata['ltv_max'])) $postdata['ltv_max'] = 100; //100;
if (!isset($postdata['loan_age_min'])) $postdata['loan_age_min'] = 0;
if (!isset($postdata['loan_age_max'])) $postdata['loan_age_max'] = 10; //10;
if (!isset($postdata['income_min'])) $postdata['income_min'] = 0;
if (!isset($postdata['income_max'])) $postdata['income_max'] = 5000000; //5000000;
if (!isset($postdata['property_owned_min'])) $postdata['property_owned_min'] = 1;
if (!isset($postdata['property_owned_max'])) $postdata['property_owned_max'] = 10; //10;
if (!isset($postdata['age_min'])) $postdata['age_min'] = 18; //18;
if (!isset($postdata['age_max'])) $postdata['age_max'] = 70; //70;
if (!isset($postdata['assets_min'])) $postdata['assets_min'] = 0;
if (!isset($postdata['assets_max'])) $postdata['assets_max'] = 10000000; //10000000;
if (!isset($postdata['debt_min'])) $postdata['debt_min'] = 0;
if (!isset($postdata['debt_max'])) $postdata['debt_max'] = 5000000; //5000000;
if (!isset($postdata['certainty'])) $postdata['certainty'] = 0;
if (!isset($postdata['sector'])) $postdata['sector'] = 0;
if ($postdata['sector'] == 0) {
$property_data = $em->getRepository('RefiBundle:Transactions')->filterProspectsBySector(0, $userId);
} else {
$property_data = $em->getRepository('RefiBundle:Transactions')->filterProspectsBySector(1, $postdata['sector']);
}
$perfect_score = 100;
$sector = array();
foreach($property_data as $key => $val) {
$score = 0;
if($postdata['property_value_min'] == $postdata['property_value_max'] && ($val['average_price'] >= $postdata['property_value_min'] || $val['average_newprice'] >= $postdata['property_value_min'])) {
$score++;
} else {
if(($val['average_price'] >= $postdata['property_value_min'] && $val['average_price'] <= $postdata['property_value_max']) || ($val['average_newprice'] >= $postdata['property_value_min'] && $val['average_newprice'] <= $postdata['property_value_max']))
$score++;
}
if($postdata['ltv_min'] == $postdata['ltv_max'] && $val['average_ltv'] >= $postdata['ltv_min']) {
$score++;
} else {
if($val['average_ltv'] >= $postdata['ltv_min'] && $val['average_ltv'] <= $postdata['ltv_max'])
$score++;
}
if($postdata['loan_age_min'] == $postdata['loan_age_max'] && $val['average_loan_age'] >= $postdata['loan_age_min']) {
$score++;
} else {
if($val['average_loan_age'] >= $postdata['loan_age_min'] && $val['average_loan_age'] <= $postdata['loan_age_max'])
$score++;
}
// if($postdata['income_min'] == $postdata['income_max'] && $val['average_income'] >= $postdata['income_min']) {
// $score++;
// } else {
// if($val['average_income'] >= $postdata['income_min'] && $val['average_income'] <= $postdata['income_max'])
// $score++;
// }
if($postdata['property_owned_min'] == $postdata['property_owned_max'] && $val['average_assets_owned'] >= $postdata['property_owned_min']) {
$score++;
} else {
if($val['average_assets_owned'] >= $postdata['property_owned_min'] && $val['average_assets_owned'] <= $postdata['property_owned_max'])
$score++;
}
if($postdata['assets_min'] == $postdata['assets_max'] && ($val['average_assets_owned'] * $val['average_newprice']) >= $postdata['assets_min']) {
$score++;
} else {
if(($val['average_assets_owned'] * $val['average_newprice']) >= $postdata['assets_min'] && ($val['average_assets_owned'] * $val['average_newprice']) <= $postdata['assets_max'])
$score++;
}
if($postdata['age_min'] == $postdata['age_max'] && $val['average_prospect_age'] >= $postdata['age_min']) {
$score++;
} else {
if($val['average_prospect_age'] >= $postdata['age_min'] && $val['average_prospect_age'] <= $postdata['age_max'])
$score++;
}
$debt = ($val['average_ltv'] / 100) * $val['average_price'];
if($postdata['debt_min'] == $postdata['debt_max'] && $debt >= $postdata['debt_min']) {
$score++;
} else {
if($debt >= $postdata['debt_min'] && $debt <= $postdata['debt_max'])
$score++;
}
$temp_score = (int) (($score / 7) * 100);
// #solution 1 ------
if(isset($temp[$val['urakey']]['num_prospects']))
$temp[$val['urakey']]['num_prospects'] += 1;
else
$temp[$val['urakey']]['num_prospects'] = 1;
if(isset($temp[$val['urakey']]['perfect_score'])) {
if($temp_score >= $perfect_score) {
$temp[$val['urakey']]['perfect_score']++;
}
} else {
if($temp_score >= $perfect_score) {
$temp[$val['urakey']]['perfect_score'] = 1;
} else {
$temp[$val['urakey']]['perfect_score'] = 0;
}
}
$temp_property_score = round(($temp[$val['urakey']]['perfect_score'] / $temp[$val['urakey']]['num_prospects']) * 100, 0);
if(isset($temp_sector_score[$val['sector']])) {
$temp_sector_score[$val['sector']] += $temp_property_score;
} else {
$temp_sector_score[$val['sector']] = $temp_property_score;
}
$sector[$val['sector']]['name'] = !empty($val['sector_name']) ? $val['sector_name'] : "Temporary Sector Name";
$sector[$val['sector']]['sector_code'] = $val['sector'];
$sector[$val['sector']]['longitude'] = $val['pr_long'];
$sector[$val['sector']]['latitude'] = $val['pr_lat'];
$sector[$val['sector']]['sector_score'] = 0;
$sector[$val['sector']]['total_sector_prospects'] = 0;
$sector[$val['sector']]['properties'][$val['urakey']]['longitude'] = $val['longitude'];
$sector[$val['sector']]['properties'][$val['urakey']]['latitude'] = $val['latitude'];
$sector[$val['sector']]['properties'][$val['urakey']]['property_score'] = $temp_property_score;
$sector[$val['sector']]['properties'][$val['urakey']]['total_property_prospects'] = $temp[$val['urakey']]['perfect_score'];
if($temp_score >= $perfect_score) {
$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][]['prospect_id'] = $val['prospectId'];
}
/* // #solution 2 ------
if(isset($temp[$val['urakey']]['num_prospects'])) {
$temp[$val['urakey']]['num_prospects'] += 1;
$temp[$val['urakey']]['temp_score'] += $temp_score;
} else {
$temp[$val['urakey']]['num_prospects'] = 1;
$temp[$val['urakey']]['temp_score'] = $temp_score;
}
$temp_property_score = $temp[$val['urakey']]['temp_score'] / $temp[$val['urakey']]['num_prospects'];
$sector[$val['sector']]['name'] = !empty($val['sector_name']) ? $val['sector_name'] : "Temporary Sector Name";
$sector[$val['sector']]['sector_code'] = $val['sector'];
$sector[$val['sector']]['longitude'] = $val['pr_long'];
$sector[$val['sector']]['latitude'] = $val['pr_lat'];
$sector[$val['sector']]['sector_score'] = 0;
$sector[$val['sector']]['total_sector_prospects'] = 0;
$sector[$val['sector']]['properties'][$val['urakey']]['longitude'] = $val['longitude'];
$sector[$val['sector']]['properties'][$val['urakey']]['latitude'] = $val['latitude'];
$sector[$val['sector']]['properties'][$val['urakey']]['property_score'] = $temp_property_score;
$sector[$val['sector']]['properties'][$val['urakey']]['total_property_prospects'] = $temp[$val['urakey']]['num_prospects'];
$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][$temp[$val['urakey']]['num_prospects'] - 1]['prospect_id'] = $val['prospectId'];
$sector[$val['sector']]['properties'][$val['urakey']]['prospects'][$temp[$val['urakey']]['num_prospects'] - 1]['prospect_score'] = $temp_score;
*/
}
foreach($sector as $keys => $vals) {
$temp_score = 0; $ctr = 0; $temp_prospects = 0;
foreach($vals['properties'] as $keyp => $valp) {
if($valp['property_score'] < $postdata['certainty'] || ($postdata['certainty'] == 0 && $valp['property_score'] <= $postdata['certainty'])) {
unset($sector[$keys]['properties'][$keyp]);
} else {
$temp_prospects += $valp['total_property_prospects'];
$temp_score++;
}
$ctr++;
}
$sector[$keys]['sector_score'] = round(($temp_score / $ctr) * 100, 0);
$sector[$keys]['total_sector_prospects'] = $temp_prospects;
}
$response = new Response(json_encode($sector));
$response->headers->set('Content-Type', 'application/json');
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filterPropertyAction(Request $request)\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usr = $this->get('security.context')->getToken()->getUser();\n\t\t\n\t\t$postdata = $request->query->all();\n if (!isset($postdata['campaign'])) $postdata['campaign'] = false;\n\t\t\n\t\tif($postdata['campaign'] == true) {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterSectorsBySectorlistClientId($usr->getId());\n\t\t} else {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterSectors();\n\t\t}\n\t\t\n\t\t$sector_data = array();\n\t\tforeach($property_data as $property_data) {\n\t\t\t$sector_data[$property_data['sector']]['name'] = $property_data['name'];\n\t\t\t$sector_data[$property_data['sector']]['sector_code'] = $property_data['sector'];\n\t\t\t$sector_data[$property_data['sector']]['longitude'] = $property_data['longitude'];\n\t\t\t$sector_data[$property_data['sector']]['latitude'] = $property_data['latitude'];\n\t\t\t$sector_data[$property_data['sector']]['total_sector_prospects'] = $property_data['num_prospects']; \n\t\t}\n\t\t\n\t\t$response = new Response(json_encode($sector_data));\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n\t}",
"function property_search () \n\t{ \n\t\t$location = preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['location']); \n\t\t$type = preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['type']); \n\t\t$buyrent = preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['buyrent']); \n\n\t\t$room_no_min = preg_replace('/[^0-9]/', '', $_GET['room_no_min']);\n\t\t$room_no_max = preg_replace('/[^0-9]/', '', $_GET['room_no_max']);\n\n\t\t// This replaces characters in the input string if need be for security reasons \n\t\t$min_val_buy = ( isset( $_GET['min_val_buy'] ) ) ? $_GET['min_val_buy'] : $_GET['min_val_rent'];\n\t\t$max_val_buy = ( isset( $_GET['max_val_buy'] ) ) ? $_GET['max_val_buy'] : $_GET['max_val_rent'];\n\n\t\t$min_val_rent = $_GET['min_val_rent'];\n\t\t$max_val_rent = $_GET['max_val_buy'];\n\n\n\t\t$meta_query = array( 'relation' => 'AND' );\n\t\tif($location) {\n\t\t\t$meta_query[] = array(\n\t\t\t\t'relation' => 'OR',\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'property_country',\n\t\t\t\t\t'value' => $location,\n\t\t\t\t\t'compare' => 'LIKE'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'property_city',\n\t\t\t\t\t'value' => $location,\n\t\t\t\t\t'compare' => 'LIKE'\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'key' => 'property_location',\n\t\t\t\t\t'value' => $location,\n\t\t\t\t\t'compare' => 'LIKE'\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif($type != 'select') {\n\t\t\t$meta_query[] = array(\n\t\t\t\t'key' => 'property_type',\n\t\t\t\t'value' => $type,\n\t\t\t\t'compare' => '='\n\t\t\t);\n\t\t}\n\n\t\tif($buyrent != 'select') {\n\t\t\tif($buyrent == 'buy') $buyrent = 'sale'; // select value \"buy\" differs in context from met_value \"sale\"\n\t\t\t$meta_query[] = array(\n\t\t\t\t'key' => 'sale_or_rent',\n\t\t\t\t'value' => $buyrent,\n\t\t\t\t'compare' => '='\n\t\t\t);\n\t\t}\n\n\t\t$meta_query[] = array(\n\t\t\t'key' => 'number_of_bedrooms',\n\t\t\t'value' => intval($room_no_min),\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => '>='\n\t\t);\n\n\t\t$meta_query[] = array(\n\t\t\t'key' => 'number_of_bedrooms',\n\t\t\t'value' => intval($room_no_max),\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => '<='\n\t\t);\n\n\t\t$meta_query[] = array(\n\t\t\t'key' => 'property_price',\n\t\t\t'value' => intval($min_val_buy),\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => '>='\n\t\t);\n\n\t\t$meta_query[] = array(\n\t\t\t'key' => 'property_price',\n\t\t\t'value' => intval($max_val_buy),\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => '<='\n\t\t);\n\n\t\t// Property search query goes here\n\n\t\t$args = array(\n\t\t\t'post_type' => 'properties',\n\t\t\t'meta_query' => $meta_query\n\t\t);\n\n\t\tif( isset( $_GET['sort'] ) ) {\n\t\t\tif($_GET['sort'] == 'newest') {\n\t\t\t\t$args['orderby'] = 'date';\n\t\t\t\t$args['order'] = 'DESC';\n\t\t\t}\n\t\t\tif($_GET['sort'] == 'oldest') {\n\t\t\t\t$args['orderby'] = 'date';\n\t\t\t\t$args['order'] = 'ASC';\n\t\t\t}\n\t\t\tif($_GET['sort'] == 'price highest') {\n\t\t\t\t$args['meta_key'] = 'property_price';\n\t\t\t\t$args['orderby'] = 'meta_value_num';\n\t\t\t\t$args['order'] = 'DESC';\n\t\t\t}\n\t\t\tif($_GET['sort'] == 'price lowest') {\n\t\t\t\t$args['meta_key'] = 'property_price';\n\t\t\t\t$args['orderby'] = 'meta_value_num';\n\t\t\t\t$args['order'] = 'ASC';\n\t\t\t}\n\t\t}\n\n\t\t$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;\n\t\t$args['paged'] = $paged;\n\n\t\t$results = new WP_Query( $args );\n\n\t\tif(($results == 0) || ($results == false) || ($results == NULL) || !is_object($results) || !($results->have_posts())) {\n\t\t\treturn $results;\n }\n\t\telse {\n\t\t\treturn $results;\n }\n\t\n}",
"private function parseForFiltering() {\n $filters = array_key_exists(\"filter\", $_GET) ? json_decode($_GET['filter'],true) : NULL;\n // If $filters was set, go on and check each item of the array.\n if (isset($filters)) {\n foreach($filters as $filter) {\n // If \"property\" and \"value\" keys exist, go on.\n if(\n array_key_exists(\"property\", $filter ) &&\n array_key_exists(\"value\", $filter )\n ) {\n // check if property is not an empty string\n if($filter[\"property\"] != \"\") {\n // add filter property=>value to the $filterStore[]\n $this->filterStore[$filter[\"property\"]] = $filter[\"value\"];\n }\n }\n }\n }\n }",
"public function searchproperties(Request $request)\n {\n // dd($request->all());\n\n $location = $request->get('location');\n $proeprty_type = $request->get('proeprty_type');\n $bedrooms = $request->get('beds');\n $min_size = $request->get('get_min_data_value');\n $max_size = $request->get('get_max_data_value');\n $min_price = $request->get('get_min_price_value');\n $max_price = $request->get('get_max_price_value');\n\n\n if(!empty($max_size)){\n if($min_size==null){\n $min_size = 1;\n }\n\n\n if($max_size=='any'){\n $max_size = 99999999999999999;\n }\n }\n\n\n if(!empty($max_price)){\n\n if($min_price==null){\n $min_price = 1;\n }\n if($max_price=='any'){\n $max_price = 99999999999999999;\n }\n }\n // dd($min_price);\n // dd($max_size);\n // dd($min_size);\n\n // ONE PART START\n //location\n if( !empty($location) && empty($proeprty_type) && empty($bedrooms) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n return redirect()->route('search.location', ['location'=>$location]);\n }\n // Proeprty Type\n if( !empty($proeprty_type) && empty($location) && empty($bedrooms) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n //dd('proeprty_type');\n return redirect()->route('search.proeprty_type', ['proeprty_type'=>$proeprty_type]);\n }\n // Bed Rooms\n if( !empty($bedrooms) && empty($location) && empty($proeprty_type) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n // dd('bedrooms');\n return redirect()->route('search.bedrooms', ['bedrooms'=>$bedrooms]);\n }\n // Min_size Max_size\n if( !empty($min_size) && !empty($max_size) && empty($location) && empty($proeprty_type) && empty($bedrooms) && empty($min_price) && empty($max_price))\n {\n // dd('min_size max_size');\n return redirect()->route('search.max_size_max_size', ['min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n // Min_size Max_size\n if( !empty($min_price) && !empty($max_price) && empty($location) && empty($proeprty_type) && empty($bedrooms) && empty($min_size) && empty($max_size))\n {\n // dd('min_price max_price');\n return redirect()->route('search.min_price_max_price', ['min_price'=>$min_price,'max_price'=>$max_price]);\n }\n //ONE PART END\n\n // TWO PART START\n //location && Proeprty Type\n if( !empty($location) && !empty($proeprty_type) && empty($bedrooms) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n // dd('location proeprty_type');\n return redirect()->route('search.location_proeprty_type', ['location'=>$location, 'proeprty_type'=>$proeprty_type]);\n }\n //location && Bed Rooms\n if( !empty($location) && !empty($bedrooms) && empty($proeprty_type) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n //dd('location bedrooms');\n return redirect()->route('search.location_bedrooms', ['location'=>$location, 'bedrooms'=>$bedrooms]);\n }\n //location && Min_size Max_size\n if( !empty($location) && !empty($min_size) && !empty($max_size) && empty($proeprty_type) && empty($bedrooms) && empty($min_price) && empty($max_price))\n {\n // dd('location min_size max_size');\n return redirect()->route('search.location_min_size_max_size', ['location'=>$location, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n //location && Min_price Max_price\n if( !empty($location) && !empty($min_price) && !empty($max_price) && empty($proeprty_type) && empty($bedrooms) && empty($min_size) && empty($max_size))\n {\n // dd('location min_price max_price');\n return redirect()->route('search.location_min_price_max_price', ['location'=>$location, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($proeprty_type) && !empty($min_size) && !empty($max_size) && empty($bedrooms) && empty($location) && empty($min_price) && empty($max_price))\n {\n // dd('proeprty_type min_size max_size');\n return redirect()->route('search.proeprty_type_min_size_max_size', ['proeprty_type'=>$proeprty_type, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n if( !empty($proeprty_type) && !empty($min_price) && !empty($max_price) && empty($bedrooms) && empty($location) && empty($min_size) && empty($max_size))\n {\n //dd('proeprty_type min_price max_price2');\n return redirect()->route('search.proeprty_type_min_price_max_price', ['proeprty_type'=>$proeprty_type, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($bedrooms) && !empty($min_price) && !empty($max_price) && empty($proeprty_type) && empty($location) && empty($min_size) && empty($max_size))\n {\n //dd('bedrooms min_price max_price');\n return redirect()->route('search.bedrooms_min_price_max_price', ['bedrooms'=>$bedrooms, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($bedrooms) && !empty($min_size) && !empty($max_size) && empty($proeprty_type) && empty($location) && empty($min_price) && empty($max_price))\n {\n // dd('bedrooms min_size max_size');\n return redirect()->route('search.bedrooms_min_size_max_size', ['bedrooms'=>$bedrooms, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n // if( !empty($min_size) && !empty($max_size) && empty($min_price) && empty($max_price) && empty($proeprty_type) && empty($location) && empty($bedrooms))\n // {\n // dd('min_size max_size');\n // return redirect()->route('search.min_size_max_size', ['min_size'=>$min_size, 'max_size'=>$max_size]);\n // }\n if( !empty($min_size) && !empty($max_size) && !empty($min_price) && !empty($max_price) && empty($proeprty_type) && empty($location) && empty($bedrooms))\n {\n // dd('min_size max_size min_price max_price');\n return redirect()->route('search.min_size_max_size_min_price_max_price', ['min_size'=>$min_size, 'max_size'=>$max_size, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n // TWO PART END\n\n // THREE PART START\n //location && Min_price Max_price\n if( !empty($location) && !empty($proeprty_type) && !empty($bedrooms) && empty($min_size) && empty($max_size) && empty($min_price) && empty($max_price))\n {\n // dd('location proeprty_type bedrooms');\n return redirect()->route('search.location_proeprty_type_bedrooms', ['location'=>$location, 'proeprty_type'=>$proeprty_type, 'bedrooms'=>$bedrooms]);\n }\n if( !empty($location) && !empty($bedrooms) && !empty($min_size) && !empty($max_size) && empty($min_price) && empty($proeprty_type) && empty($max_price) )\n {\n //dd('location bedrooms min_size max_size');\n return redirect()->route('search.location_bedrooms_min_size_max_size', ['location'=>$location, 'bedrooms'=>$bedrooms, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n if( !empty($location) && !empty($bedrooms) && !empty($min_price) && !empty($max_price) && empty($min_size) && empty($proeprty_type) && empty($max_size) )\n {\n //dd('location bedrooms min_price max_price');\n return redirect()->route('search.location_bedrooms_min_price_max_price', ['location'=>$location, 'bedrooms'=>$bedrooms, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($location) && !empty($proeprty_type) && !empty($min_size) && !empty($max_size) && empty($bedrooms) && empty($min_price) && empty($max_price))\n {\n //dd('location proeprty_type min_size max_size');\n return redirect()->route('search.location_proeprty_type_min_size_max_size', ['location'=>$location, 'proeprty_type'=>$proeprty_type, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n if( !empty($location) && !empty($proeprty_type) && !empty($min_price) && !empty($max_price) && empty($bedrooms) && empty($min_size) && empty($max_size))\n {\n //dd('location proeprty_type min_price max_price');\n return redirect()->route('search.location_proeprty_type_min_price_max_price', ['location'=>$location, 'proeprty_type'=>$proeprty_type, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($proeprty_type) && !empty($bedrooms) && !empty($min_size) && !empty($max_size) && empty($location) && empty($min_price) && empty($max_price))\n {\n //dd('proeprty_type bedrooms min_size max_size');\n return redirect()->route('search.proeprty_type_bedrooms_min_size_max_size', ['proeprty_type'=>$proeprty_type, 'bedrooms'=>$bedrooms, 'min_size'=>$min_size, 'max_size'=>$max_size]);\n }\n if( !empty($proeprty_type) && !empty($bedrooms) && !empty($min_price) && !empty($max_price) && empty($location) && empty($min_size) && empty($max_size))\n {\n //dd('proeprty_type bedrooms min_price max_price');\n return redirect()->route('search.proeprty_type_bedrooms_min_price_max_price', ['proeprty_type'=>$proeprty_type, 'bedrooms'=>$bedrooms, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($location) && !empty($min_size) && !empty($max_size) && !empty($min_price) && !empty($max_price) && empty($proeprty_type) && empty($bedrooms))\n {\n //dd('location min_size max_size min_price max_price');\n return redirect()->route('search.location_min_size_min_max_size_price_max_price', ['location'=>$location, 'min_size'=>$min_size, 'max_size'=>$max_size, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( !empty($proeprty_type) && !empty($min_size) && !empty($max_size) && !empty($min_price) && !empty($max_price) && empty($location) && empty($bedrooms))\n {\n return redirect()->route('search.proeprty_type_size_min_max_size_price_max_price', ['proeprty_type'=>$proeprty_type, 'min_size'=>$min_size, 'max_size'=>$max_size, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if(!empty($location) && !empty($proeprty_type) && !empty($min_size) && !empty($max_size) && !empty($min_price) && !empty($max_price) && empty($bedrooms))\n {\n\n return redirect()->route('search.location_proeprty_type_size_min_max_size_price_max_price', ['location'=>$location,'proeprty_type'=>$proeprty_type, 'min_size'=>$min_size, 'max_size'=>$max_size, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n // THREE PART END\n\n //All Searching\n if( !empty($location) && !empty($min_price) && !empty($max_price) && !empty($proeprty_type) && !empty($bedrooms) && !empty($min_size) && !empty($max_size))\n {\n // dd('all');\n return redirect()->route('search.all_search', ['location'=>$location, 'proeprty_type'=>$proeprty_type, 'bedrooms'=>$bedrooms, 'min_size'=>$min_size, 'max_size'=>$max_size, 'min_price'=>$min_price, 'max_price'=>$max_price]);\n }\n if( empty($location) && empty($min_price) && empty($max_price) && empty($proeprty_type) && empty($bedrooms) && empty($min_size) && empty($max_size))\n {\n Session::flash('success', 'Please missing some parameter for property.');\n return back();\n }\n }",
"private function processFilterForm(sfWebRequest $request)\n {\n\n\t\tif (!$request->getParameter('filter')){\n\t\t\t$this->has_filters = UserFilterPeer::getByPersonId($this->getUser()->getId());\n\t\t\t//here set all values\n\t\t\tif($this->has_filters) {\n\n\t\t\t\t$params['origin'] = $this->has_filters->getOrgin();\n\t\t\t\t$params['dest'] = $this->has_filters->getDest();\n\n\t\t\t\t$params['date_range1'] = $this->has_filters->getDateRange1();\n\t\t\t\t$params['date_range2'] = $this->has_filters->getDateRange2();\n\n\t\t\t\t$params['filled'] = $this->has_filters->getFilled();\n\t\t\t\t$params['open'] = $this->has_filters->getOpen();\n\n\t\t\t\t//needs by\n\t\t\t\t$params['needs_pilot'] = $this->has_filters->getIsPilot();\n\t\t\t\t$params['co_pilot'] = $this->has_filters->getIsMa();\n\t\t\t\t$params['ifr'] = $this->has_filters->getIfrBackup();\n\n\t\t\t\t$params['ignore_availability'] = $this->has_filters->getAvailability();\n\n\t\t\t\t//days\n\t\t\t\t$weekdays = array();\n\t\t\t\t$weekdays[0] = $this->has_filters->getDay1();\n\t\t\t\t$weekdays[1] = $this->has_filters->getDay2();\n\t\t\t\t$weekdays[2] = $this->has_filters->getDay3();\n\t\t\t\t$weekdays[3] = $this->has_filters->getDay4();\n\t\t\t\t$weekdays[4] = $this->has_filters->getDay5();\n\t\t\t\t$weekdays[5] = $this->has_filters->getDay6();\n\t\t\t\t$weekdays[6] = $this->has_filters->getDay7();\n\n\t\t\t\t$params['weekdays'] = $weekdays;\n\n\t\t\t\t$params['max_pass'] = $this->has_filters->getMaxPassenger();\n\t\t\t\t$params['max_weight'] = $this->has_filters->getMaxWeight();\n\t\t\t\t$params['max_distance'] = $this->has_filters->getMaxDistance();\n\t\t\t\t$params['min_efficiency'] = $this->has_filters->getMaxEffciency();\n\n\t\t\t\t$params['wing_id'] = $this->has_filters->getWing();\n\t\t\t\t$params['ident'] = $this->has_filters->getIdent();\n\t\t\t\t$params['city'] = $this->has_filters->getCity();\n\t\t\t\t$params['zip'] = $this->has_filters->getZipcode();\n\t\t\t\t$params['state'] = $this->has_filters->getState();\n\n\t\t\t\t$arr = array();\n\t\t\t\t//if saved filters, get selected mission types\n\t\t\t\tif($this->has_filters) {\n\t\t\t\t\t$s = $this->has_filters->getUserFilterMissionTypess();\n\t\t\t\t\tif (sizeof($s) > 0) {\n\t\t\t\t\t\tforeach ($s as $ru) {\n\t\t\t\t\t\t\tif($this->has_filters) {\n\t\t\t\t\t\t\t\t$arr[] = $ru->getMissionTypeId();\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t$arr[] = $ru->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$params['selected_types'] = $arr;\n\n\t\t\t\t}\n\t\t\t}//end if has_filter\n\t\t}//end if !filter\n\t\telse{\n\t\t\t$params = $this->getUser()->getAttribute('staff_available', array(), 'person');\n\t\t}\n\t\t//mission types selected by default\n\t\t$arr = array();\n\t\tif (sizeof($this->mission_types) > 0) {\n\t\t\tforeach ($this->mission_types as $ru) {\n\t\t\t\t$arr[] = $ru->getId();\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($params['sort_by'])) $params['sort_by'] = 1;\n\t\tif (!isset($params['date_range1'])) $params['date_range1'] = null;\n\t\tif (!isset($params['date_range2'])) $params['date_range2'] = null;\n\t\tif (!isset($params['weekdays'])) $params['weekdays'] = array(1, 1, 1, 1, 1, 1, 1);\n\t\tif (!isset($params['wing_id'])) $params['wing_id'] = null;\n\t\tif (!isset($params['ident'])) $params['ident'] = null;\n\t\tif (!isset($params['city'])) $params['city'] = null;\n\t\tif (!isset($params['state'])) $params['state'] = null;\n\t\tif (!isset($params['zip'])) $params['zip'] = null;\n\t\tif (!isset($params['origin'])) $params['origin'] = 1;\n\t\tif (!isset($params['dest'])) $params['dest'] = 1;\n\t\tif (!isset($params['needs_pilot'])) $params['needs_pilot'] = null;\n\t\tif (!isset($params['co_pilot'])) $params['co_pilot'] = null;\n\t\tif (!isset($params['ifr'])) $params['ifr'] = null;\n\t\tif (!isset($params['selected_types'])) $params['selected_types'] = $arr;\n\t\tif (!isset($params['filled'])) $params['filled'] = null;\n\t\tif (!isset($params['open'])) $params['open'] = null;\n\t\tif (!isset($params['max_pass'])) $params['max_pass'] = null;\n\t\tif (!isset($params['max_weight'])) $params['max_weight'] = null;\n\t\tif (!isset($params['max_distance'])) $params['max_distance'] = null;\n\t\tif (!isset($params['min_efficiency'])) $params['min_efficiency'] = null;\n\t\tif (!isset($params['ignore_availability'])) $params['ignore_availability'] = null;\n\n\t\tif (!isset($params['member_id'])) $params['member_id'] = null;\n\n\t\tif ($this->hasRequestParameter('sort_by')) $params['sort_by'] = $this->getRequestParameter('sort_by');\n\t\tif ($request->getParameter('filter') && $request->getParameter('filter')==1) {\n\t\t\t$params['date_range1'] = $request->getParameter('date_range1');\n\t\t\t$params['date_range2'] = $request->getParameter('date_range2');\n\t\t\t$params['weekdays'] = $request->getParameter('weekdays', array(1, 1, 1, 1, 1, 1, 1));\n\t\t\t$params['wing_id'] = $request->getParameter('wing_id');\n\t\t\t$params['ident'] = $request->getParameter('ident');\n\t\t\t$params['city'] = $request->getParameter('city');\n\t\t\t$params['state'] = $request->getParameter('state');\n\t\t\t$params['zip'] = $request->getParameter('zipcode');\n\t\t\t$params['origin'] = $request->getParameter('origin');\n\t\t\t$params['dest'] = $request->getParameter('dest');\n\t\t\t$params['needs_pilot'] = $request->getParameter('needs_pilot');\n\t\t\t$params['co_pilot'] = $request->getParameter('co_pilot');\n\t\t\t$params['ifr'] = $request->getParameter('ifr');\n\t\t\t$params['selected_types'] = $request->getParameter('selected_types[]', $arr);\n\t\t\t$params['filled'] = $request->getParameter('filled');\n\t\t\t$params['open'] = $request->getParameter('open');\n\t\t\t$params['max_pass'] = $request->getParameter('max_pass');\n\t\t\t$params['max_weight'] = $request->getParameter('max_weight');\n\t\t\t$params['max_distance'] = $request->getParameter('max_distance');\n\t\t\t$params['min_efficiency'] = $request->getParameter('min_efficiency');\n\t\t\t$params['ignore_availability'] = $request->getParameter('ignore_availability');\n\n\n\t\t\t$params['member_id'] = $request->getParameter('member_id');\n\t\t}\n\n\t\t$this->page = $request->getParameter('page', 1);\n\t\t$this->max = sfConfig::get('app_max_mission_available_per_pager', 10);\n\t\t$this->sort_by = $params['sort_by'];\n\t\t$this->date_range1 = $params['date_range1'];\n\t\t$this->date_range2 = $params['date_range2'];\n\t\t$this->weekdays = $params['weekdays'];\n\t\t$this->wing_id = $params['wing_id'];\n\t\t$this->ident = $params['ident'];\n\t\t$this->city = $params['city'];\n\t\t$this->state = $params['state'];\n\t\t$this->zip = $params['zip'];\n\t\t$this->origin = $params['origin'];\n\t\t$this->dest = $params['dest'];\n\t\t$this->needs_pilot = $params['needs_pilot'];\n\t\t$this->co_pilot = $params['co_pilot'];\n\t\t$this->ifr = $params['ifr'];\n\t\t$this->selected_types = $params['selected_types'];\n\t\t$this->filled = $params['filled'];\n\t\t$this->open = $params['open'];\n\t\t$this->max_pass = $params['max_pass'];\n\t\t$this->max_weight = $params['max_weight'];\n\t\t$this->max_distance = $params['max_distance'];\n\t\t$this->min_efficiency = $params['min_efficiency'];\n\t\t$this->ignore_availability = $params['ignore_availability'];\n\n\t\t$this->member_id = $params['member_id'];\n\n\t\t$this->getUser()->setAttribute('staff_available', $params, 'person');\n\t\t$this->error_min_eff = false;\n\t\tif(isset ($this->min_efficiency) && $this->min_efficiency!=null && !($this->min_efficiency >= 1 && $this->min_efficiency <=100))\n\t\t$this->error_min_eff = true;\n }",
"public function car_input_parameters() {\n\t\t$data = array();\n\t\t$data['commission_rate'] = get_web_meta_data('commission_rate');\n\t\t$data['car_element_mileage'] = get_web_meta_data('car_element_mileage');\n\t\t$data['car_element_cubic_capacity'] = get_web_meta_data('car_element_cubic_capacity');\n\t\t$data['car_element_doors'] = get_web_meta_data('car_element_doors');\n\t\t$data['car_element_airbags'] = get_web_meta_data('car_element_airbags');\n\t\t$data['car_element_seats'] = get_web_meta_data('car_element_seats');\n\t\t$data['car_element_feature_types'] = $this->UserModel->get_all_feature_types();\n\t\t\n\t\t$years = get_web_meta_data('car_element_year');\n\t\t$years_temp = array();\n\t\tfor($i=date('Y');$i>(date('Y')-$years);$i--){\n\t\t\t$years_temp[] = intval($i);\n\t\t}\n\t\t$data['car_element_year'] = $years_temp;\n\t\techo json_encode(array(\"isSuccess\" => true, \"message\" => \"Data Fetched\", \"Result\" => $data));\n\t\tdie;\n\t}",
"public function determineStartingFilters()\n {\n foreach (collect($this->filter)->except(self::EXCLUDED_FILTERS) as $key => $value) {\n $this->filter[$key] = [Trade::min($key), Trade::max($key)];\n }\n\n // Determine bounds for calculated fields\n $this->filter['total_volume'] = [\n Trade::min('units_per_hour') * Trade::min('duration'),\n Trade::max('units_per_hour') * Trade::max('duration'),\n ];\n }",
"private function processFilter(sfWebRequest $request)\n\t{\n\t\t$params = $this->getUser()->getAttribute('aircraft', array(), 'aircraft');\n\n\t\tif (!isset($params['make'])) $params['make'] = null;\n\t\tif (!isset($params['model'])) $params['model'] = null;\n\t\tif (!isset($params['name'])) $params['name'] = null;\n\n\t\t$this->max_array = array(5, 10, 20, 30);\n\n\t\tif (in_array($request->getParameter('max'), $this->max_array)) {\n\t\t\t$params['max'] = $request->getParameter('max');\n\t\t}else{\n\t\t\tif (!isset($params['max'])) $params['max'] = sfConfig::get('app_max_person_per_page', 10);\n\t\t}\n\n\t\tif ($request->hasParameter('filter')) {\n\t\t\t$params['make'] = $request->getParameter('make');\n\t\t\t$params['model'] = $request->getParameter('model');\n\t\t\t$params['name'] = $request->getParameter('name');\n\t\t}\n\t\t\n\t\tif($request->hasParameter('search') && $request->getParameter('search') == 'pilots')\n\t\t{\n\t\t\t$params['name'] = $request->getParameter('name');\n\t\t}\n\t\t$this->page = $page = $request->getParameter('page', 1);\n\t\t$this->max = $params['max'];\n\t\t$this->make = $params['make'];\n\t\t$this->model = $params['model'];\n\t\t$this->name = $params['name'];\n\n\t\t$this->getUser()->setAttribute('aircraft', $params, 'aircraft');\n\t}",
"public function getFilterParameters();",
"public function data(Request $request)\n {\n $properties = Property::query();\n\n if ($request->has('name') && mb_strlen($request->input('name')) > 1) {\n $properties->where('name', 'like', '%' . $request->input('name') . '%');\n }\n\n if ($request->has('price_min') && $request->has('price_max')) {\n $properties->whereBetween('price', [$request->input('price_min'), $request->input('price_max')]);\n }\n\n foreach (['bedrooms', 'bathrooms', 'storeys', 'garages'] as $prop) {\n if ($request->has($prop)) {\n $properties->where($prop, $request->input($prop));\n }\n }\n\n return $properties->get();\n }",
"private static function getPropertyFilters(Request $request)\n {\n $filters = [\n 'typology' => $request->input('typology'),\n 'land_registry_id' => $request->input('landregistry'),\n ];\n\n return $filters;\n }",
"function parse_filter() {\n if (!empty($this->http_request->params['filter'][0])) {\n $scrubbed_filters = array();\n foreach ($this->http_request->params['filter'] as $filter) {\n preg_match('/^([^:]*:)(.*)$/', $filter, $matches);\n $field = $matches[1];\n\t\t$value = '*';\n\n\t\tif (!empty($matches[2])){\n\t\t\t$value = $matches[2];\t\n\t\t}\n\n // If we have a range filter we don't want to escape the [ TO ]\n // TODO: Should we always be escaping? Not sure...\n if (! preg_match('/^\\[.+ TO/', $value)) {\n $value = solr\\utils::escape_solr_value($value);\n }\n \n // Test for list of id's\n if (($field == \"id:\") && (preg_match(\"/,/\", $value, $match))) {\n \t$ids = explode(\",\", $value);\n \t$id_string = \"\";\n \tforeach($ids as $id) {\n \t\t$id_string .= \"id:$id OR \";\n \t}\n \t// Remove initial \"id:\" and final orphan \" OR \"\n \t$id_string = preg_replace(\"/^id:/\", \"\", $id_string);\n \t$id_string = preg_replace(\"/\\sOR\\s$/\", \"\", $id_string);\n \t$value = $id_string;\n }\n \n // Test for list of collections\n if (($field == \"collection:\") && (preg_match(\"/,/\", $value, $match))) {\n \t$collections = explode(\",\", $value);\n \t$collection_string = \"\";\n \tforeach($collections as $collection) {\n \t\t$collection_string .= \"collection:$collection OR \";\n \t}\n \t// Remove initial \"collection:\" and final orphan \" OR \"\n \t$collection_string = preg_replace(\"/^collection:/\", \"\", $collection_string);\n \t$collection_string = preg_replace(\"/\\sOR\\s$/\", \"\", $collection_string);\n \t$value = $collection_string;\n }\n \n $scrubbed_filters[] = $field . $value;\n }\n $this->solr_data_store_request->params['fq'] = $scrubbed_filters;\n }\n }",
"private function validateDataProperties(Request $request)\n {\n\n $this->validate($request, [\n 'property_type' => 'required|array',\n 'property_type.*' => 'in:apartment,house,condo,farmhouse,flat,studio,land,roof,warehouse,commercial_set,farm,store,commercial_room,commercial_building',\n 'description' => 'required',\n 'complement' => 'nullable',\n 'cep' => 'required|size:8',\n 'number' => 'required',\n 'street' => 'required',\n 'neighborhood' => 'required',\n 'city' => 'required',\n 'state' => 'required|size:2',\n 'lat' => 'required|numeric',\n 'lng' => 'required|numeric',\n 'rooms' => 'required|numeric',\n 'bathrooms' => 'required|numeric',\n 'parking_spaces' => 'required|numeric',\n 'area' => 'required|numeric',\n 'quantity' => 'required|numeric',\n 'video' => 'nullable|file',\n 'price' => 'numeric',\n 'picture' => 'array',\n 'picture.*' => 'image',\n 'blueprint' => 'array',\n 'blueprint.*' => 'image',\n 'tour' => 'nullable'\n ]);\n }",
"public function index(Request $request)\n {\n // Search filters\n $operationType = $request->operationType;\n $viewStyle = $request->view_style;\n\n $onlyInvest = $request->query('only_invest', null);\n $sortBy = $request->query('sort', 'new_asc');\n $searchText = $request->query('search', null);\n $priceMin = $request->query('price_min', null);\n $priceMax = $request->query('price_max', null);\n $propertyTypeName = $request->query('type', null);\n $cityName = $request->query('city', null);\n $stateName = $request->query('state', null);\n $locationColonyName = $request->query('location_colony', null);\n\n $propertyMaxPrice = Property::orderBy('sell_price', 'desc')->orderBy('rent_price', 'desc');\n\n switch ($operationType) {\n case GeneralHelper::PROPERTY_OPERATION_RENT:\n $propertyMaxPrice = $propertyMaxPrice->where('is_rent_operation', 1);\n $propertyMaxPrice = $propertyMaxPrice->where('is_sell_operation', 0);\n\n break;\n case GeneralHelper::PROPERTY_OPERATION_SELL:\n $propertyMaxPrice = $propertyMaxPrice->where('is_rent_operation', 0);\n $propertyMaxPrice = $propertyMaxPrice->where('is_sell_operation', 1);\n break;\n }\n\n $propertyMaxPrice = $propertyMaxPrice->first();\n\n if ($propertyMaxPrice) {\n if (!empty($propertyMaxPrice->sell_price)) {\n $priceToUse = $propertyMaxPrice->sell_price;\n } else {\n $priceToUse = $propertyMaxPrice->rent_price;\n }\n\n $maxExistingPrice = round(round($priceToUse), -2);\n } else {\n $maxExistingPrice = 1000;\n }\n\n // Get filtered properties\n $queryBuilder = Property::where('show_in_list', 1)\n ->when(\n $propertyTypeName,\n function ($query, $propertyTypeName) {\n $query->whereHas(\n 'propertyType',\n function ($query) use ($propertyTypeName) {\n $query->where('name', $propertyTypeName);\n }\n );\n }\n )\n ->when(\n $searchText,\n function ($query, $searchText) {\n $query->where('name', 'like', '%'.GeneralHelper::escapeLike($searchText).'%');\n }\n )\n ->when(\n $priceMin,\n function ($query, $priceMin) {\n $query->where(\n function ($query) use ($priceMin) {\n $query->where('rent_price', '>=', $priceMin);\n $query->orWhere('sell_price', '>=', $priceMin);\n }\n );\n }\n )\n ->when(\n $cityName,\n function ($query, $cityName) {\n $query->whereHas(\n 'city',\n function ($query) use ($cityName) {\n $query->where('name', $cityName);\n }\n );\n }\n )\n ->when(\n $stateName,\n function ($query, $stateName) {\n $query->whereHas(\n 'city.state',\n function ($query) use ($stateName) {\n $query->where('name', $stateName);\n }\n );\n }\n )\n ->when(\n $sortBy,\n function ($query, $sortBy) {\n\n switch ($sortBy) {\n case 'new_asc':\n $query->orderBy('created_at', 'asc')\n ->orderBy('id', 'asc');\n break;\n case 'new_desc':\n $query->orderBy('created_at', 'desc')\n ->orderBy('id', 'desc');\n break;\n case 'price_desc':\n $query->orderBy('sell_price', 'desc');\n $query->orderBy('rent_price', 'desc');\n break;\n case 'price_asc':\n $query->orderBy('rent_price', 'asc');\n $query->orderBy('sell_price', 'asc');\n break;\n }\n }\n )\n ->when(\n $operationType,\n function ($query, $operationType) {\n\n $query->where(\n function ($query) use ($operationType) {\n switch ($operationType) {\n case GeneralHelper::PROPERTY_OPERATION_RENT:\n $query->where('is_rent_operation', 1);\n break;\n case GeneralHelper::PROPERTY_OPERATION_SELL:\n $query->where('is_sell_operation', 1);\n break;\n case GeneralHelper::PROPERTY_OPERATION_RENT_AND_SELL:\n $query->where('is_sell_operation', 1);\n $query->orWhere('is_rent_operation', 1);\n break;\n }\n }\n );\n }\n )\n ->whereHas(\n 'propertyType',\n function ($query) use ($onlyInvest) {\n\n if ($onlyInvest) {\n $query->where('is_piece_of_land', 1);\n } else {\n $query->where('is_piece_of_land', 0);\n }\n }\n )\n ->when(\n $locationColonyName,\n function ($query, $locationColonyName) {\n $query->where('location_colony', $locationColonyName);\n }\n )\n ->orderBy('created_at', ($sortBy == 'new_asc') ? 'asc' : 'desc');\n\n $suggestedQueryBuilder = clone $queryBuilder;\n $properties = $queryBuilder->when(\n $priceMax,\n function ($query, $priceMax) {\n $query->where(\n function ($query) use ($priceMax) {\n $query->where('rent_price', '<=', $priceMax);\n $query->orWhere('sell_price', '<=', $priceMax);\n $query->orWhere('sell_price', '<=', 12);\n }\n );\n }\n )\n ->paginate(15);\n\n if ($priceMax && $operationType == GeneralHelper::PROPERTY_OPERATION_RENT) {\n $priceMaxWithExtra = $priceMax + 1000;\n\n $suggestedProperties = $suggestedQueryBuilder->where(\n function ($query) use ($priceMax, $priceMaxWithExtra) {\n $query->where('rent_price', '<=', $priceMaxWithExtra);\n $query->where('rent_price', '>', $priceMax);\n }\n )\n ->limit(6)\n ->get();\n } else {\n $suggestedProperties = collect([]);\n }\n\n $usePieceOfLand = $onlyInvest ? 1 : 0;\n $propertyTypes = PropertyType::where('is_piece_of_land', $usePieceOfLand)->get();\n\n $states = State::has('cities')->get();\n $cities = City::when(\n $stateName,\n function ($query, $stateName) {\n $query->whereHas(\n 'state',\n function ($query) use ($stateName) {\n $query->where('name', $stateName);\n }\n );\n }\n )\n ->get();\n $propertyColonies = Property::select('location_colony')\n ->when(\n $stateName,\n function ($query, $stateName) {\n $query->whereHas(\n 'city.state',\n function ($query) use ($stateName) {\n $query->where('name', $stateName);\n }\n );\n }\n )\n ->when(\n $cityName,\n function ($query, $cityName) {\n $query->whereHas(\n 'city',\n function ($query) use ($cityName) {\n $query->where('name', $cityName);\n }\n );\n }\n )\n ->groupBy('location_colony')\n ->get();\n\n return view(\n 'property/index',\n [\n 'onlyInvest' => $onlyInvest,\n 'sortBy' => $sortBy,\n 'searchText' => $searchText,\n 'priceMin' => $priceMin,\n 'priceMax' => $priceMax,\n 'operationType' => $operationType,\n 'viewStyle' => $viewStyle,\n 'propertyTypeName' => $propertyTypeName,\n 'cityName' => $cityName,\n 'stateName' => $stateName,\n 'maxExistingPrice' => $maxExistingPrice,\n 'properties' => $properties,\n 'suggestedProperties' => $suggestedProperties,\n 'propertyTypes' => $propertyTypes,\n 'states' => $states,\n 'cities' => $cities,\n 'propertyColonies' => $propertyColonies,\n 'locationColonyName' => $locationColonyName,\n ]\n );\n }",
"function get() {\n\t\t// Configure::write('debug',2);\n\t\t$this->LoadModel('PerformanceViewFactura');\n\t\t$this->LoadModel('PerformanceBsu');\n\t\t$this->LoadModel('PerformanceCustomer');\n\n\t\t$posted = json_decode(base64_decode($this->params['named']['data']),true);\n\n\t\t$conditions = array();\n\n\t\tforeach ($posted as $keys => $postvalue) {\n\t\t\tif ($keys > 0 ) {\n\n\t\t\t\t$content = $postvalue['name'];\n\t\t\t\t$chars = preg_split('/\\[([^\\]]*)\\]/i', $content, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\tif ( isset($chars[2]) && $chars[2] == 'performance_bsu' && $postvalue['value'] != '') {\n\t\t\t\t\t$add_conditions[] = $postvalue['value'];\n\t\t\t\t}\n\t\t\t\t// debug($chars);\n\t\t\t\tif(isset($chars[2])) {\n\t\t\t\t\t$conditions[$chars[2]] = $postvalue['value'];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t// debug($posted);\n\t\t$conditions['performance_bsu'] = $add_conditions;\n\n\t\t//1. Transform request parameters to MySQL datetime format.\n\t\t$date_init = new DateTime($conditions['performance_dateini']);\n\t\t$mysqlstart = $date_init->format('Y-m-d');\n\t\t// debug($mysqlstart);\n\t\t$date_end = new DateTime($conditions['performance_dateend']);\n\t\t$mysqlend = $date_end->format('Y-m-d');\n\t\t// debug($mysqlend);\n\n\t\tif ( $mysqlstart == $mysqlend) {\n\t\t\t$conditionsPerformance['PerformanceViewFactura.ElaboracionFactura'] = $mysqlstart;\n\t\t} else {\n\t\t\t$conditionsPerformance['PerformanceViewFactura.ElaboracionFactura BETWEEN ? AND ?'] = array($mysqlstart,$mysqlend);\n\t\t}\n\n\t\tif (isset($conditions['performance_fraccion']) AND $conditions['performance_fraccion'] != '') {\n\t\t\tif ($conditions['performance_fraccion'] == '1') {\n\t\t\t\t$conditionsPerformance['PerformanceViewFactura.Clasificacion'] = array('Granel');\n\t\t\t}\n\t\t\tif ($conditions['performance_fraccion'] == '2') {\n\t\t\t\t$conditionsPerformance['PerformanceViewFactura.Clasificacion'] = array('Terceros');\n\t\t\t}\n\t\t\tif ($conditions['performance_fraccion'] == '3') {\n\t\t\t\t$conditionsPerformance['PerformanceViewFactura.Clasificacion'] = array('Otros');\n\t\t\t}\n\t\t\tif ($conditions['performance_fraccion'] == '4') {\n\t\t\t\t$conditionsPerformance['PerformanceViewFactura.Clasificacion'] = array('Colaboracion');\n\t\t\t}\n\t\t\tif ($conditions['performance_fraccion'] == '5') {\n\t\t\t\t$conditionsPerformance['PerformanceViewFactura.Clasificacion'] = null;\n\t\t\t}\n\t\t}\n\n\t\t/** TODO search by Customer*/\n\t\tif (isset($conditions['performance_customers_id']) and $conditions['performance_customers_id'] != '') {\n\t\t\t$conditionsPerformance['PerformanceCustomers.id'] = $conditions['performance_customers_id'];\n\t\t}\n\n\t\t$conditionsPerformance['PerformanceViewFactura.Empresa'] = $conditions['performance_bsu'];\n\n\n\t\t$performanceReferences = $this->PerformanceViewFactura->find('all',array('conditions'=>$conditionsPerformance,'order'=>array('PerformanceViewFactura.performance_customers_id'=>'desc')));\n\n\t\t// NOTE FILTER\n\t\t$condBsu['PerformanceBsu.id'] = $conditions['performance_bsu'];\n\t\t$bsu_compact = ucwords(strtolower(implode(',',$this->PerformanceBsu->find('list',array('fields'=>array('id','label'),'conditions'=>$condBsu)))));\n\n\t\t$dashboard = array('inicio'=>$mysqlstart,'fin'=>$mysqlend,'bsu'=>$bsu_compact);\n\n\t\tforeach ($performanceReferences as $key_performance => $data_performance) {\n\t\t\t# code...\n\t\t\t$performanceReferencesMod[$data_performance['PerformanceViewFactura']['performance_customers_id']][]['PerformanceViewFactura'] = $data_performance['PerformanceViewFactura'] ;\n\t\t\t$performanceReferencesIdx[$data_performance['PerformanceViewFactura']['performance_customers_id']] = $data_performance['PerformanceViewFactura']['Nombre'] ;\n\n\t\t\tif (!empty($data_performance['PerformanceViewFactura']['ElaboracionFactura']) AND !empty($data_performance['PerformanceViewFactura']['entregaFacturaCliente'])) {\n\n\t\t\t\t$performanceReferencesResume[$data_performance['PerformanceViewFactura']['performance_customers_id']]['deliver'][] = $data_performance['PerformanceViewFactura']['deliver'];\n\t\t\t}\n\n\t\t\tif (!empty($data_performance['PerformanceViewFactura']['aprobacionFactura']) AND !empty($data_performance['PerformanceViewFactura']['entregaFacturaCliente'])) {\n\n\t\t\t\t$performanceReferencesResume[$data_performance['PerformanceViewFactura']['performance_customers_id']]['proved'][] = $data_performance['PerformanceViewFactura']['proved'];\n\t\t\t}\n\n\t\t\tif (!empty($data_performance['PerformanceViewFactura']['aprobacionFactura'])) {\n\t\t\t\t$performanceReferencesResume[$data_performance['PerformanceViewFactura']['performance_customers_id']]['promise'][] = \t$data_performance['PerformanceViewFactura']['promise'];\n\t\t\t}\n\n\t\t\tif (!empty($data_performance['PerformanceViewFactura']['fechaPago']) AND !empty($data_performance['PerformanceViewFactura']['fechaPromesaPago'])) {\n\t\t\t\t$performanceReferencesResume[$data_performance['PerformanceViewFactura']['performance_customers_id']]['payment'][] = $data_performance['PerformanceViewFactura']['payment'];\n\t\t\t}\n\n\t\t\tif (!empty($data_performance['PerformanceViewFactura']['Total'])) {\n\t\t\t\t$performanceReferencesResume[$data_performance['PerformanceViewFactura']['performance_customers_id']]['amount'][$data_performance['PerformanceViewFactura']['Referencia']] = (float)$data_performance['PerformanceViewFactura']['Total'];\n\t\t\t}\n\t\t}\n\n\n\n\t\tif (!isset($performanceReferencesResume)) {\n\t\t\t$performanceReferencesResume = null ;\n\t\t}\n\t\t$generalResume = $performanceReferencesResume;\n\t\t$general['Dias de Entrega'] = null;\n\t\t$general['Dias de Aprobacion'] = null;\n\t\t$general['Dias de Promesa'] = null;\n\t\t$general['Dias de Pago'] = null;\n\t\t$general['Cantidad'] = null;\n\t\t// Quantities\n\t\t$general['Entrega'] = null;\n\t\t$general['Aprobado'] = null;\n\t\t$general['Promesa'] = null;\n\t\t$general['Pago'] = null;\n\t\t$general['Monto'] = null;\n\n\t\t// debug($generalResume);\n\n\tif (isset($generalResume)) {\n\t\tforeach ( $generalResume as $resumenkey => $resumenvalue ) {\n\t\t\t# code...\n\t\t\tdebug($resumenvalue);\n\t\t\t$general['Dias de Entrega'] += array_sum($resumenvalue['deliver']);\n\t\t\t$general['Dias de Aprobacion'] += array_sum($resumenvalue['proved']);\n\t\t\t$general['Dias de Promesa'] += array_sum($resumenvalue['promise']);\n\t\t\t$general['Dias de Pago'] += array_sum($resumenvalue['payment']);\n\t\t\t// $general['Cantidad'] += count($resumenvalue['deliver']);\n\t\t\t$general['Monto'] += array_sum($resumenvalue['amount']);\n\n\t\t\t// NOTE Counts\n\t\t\tforeach ($resumenvalue as $rkey => $rvalue) {\n\t\t\t\tforeach ($rvalue as $gkey => $gvalue) {\n\t\t\t\t\t// if ($gvalue > 0 ) {\n\t\t\t\t\t\tif (!isset($subgeneral[$resumenkey][$rkey])) {\n\t\t\t\t\t\t\t$subgeneral[$resumenkey][$rkey] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!isset($generalall[$rkey])) {\n\t\t\t\t\t\t\t$generalall[$rkey] = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$subgeneral[$resumenkey][$rkey] += 1;\n\t\t\t\t\t\t$generalall[$rkey] += 1;\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t} // NOTE end foreach\n\n\n\t\t\t//Continue\n\t\t} // NOTE end General\n\n// debug($subgeneral);\n// debug($generalall);\n\n// debug(array_key_exists('Cantidad',$general));\n\n\t\t$general['Entrega'] = $generalall['deliver'];\n\t\t$general['Aprobado'] = $generalall['proved'];\n\t\t$general['Promesa'] = $generalall['promise'];\n\t\t$general['Pago'] = $generalall['payment'];\n\n\t\tforeach ($general as $key => $value) {\n\t\t\t# code...\n\t\t\tif ($key != 'Entrega' and $key != 'Aprobado' and $key != 'Promesa' and $key != 'Pago') {\n\n\t\t\t\tif ($key == 'Dias de Entrega') {\n\t\t\t\t\t$result_array[$key] =\n\t\t\t\t\tnumber_format(\n\t\t\t\t\t\t\tmoney_format(\n\t\t\t\t\t\t\t\t\t'%i',\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t$value / $generalall['deliver']\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t), 2, '.', ','\n\t\t\t\t\t);\n\t\t\t\t} else if ($key == 'Dias de Aprobacion') {\n\t\t\t\t\t$result_array[$key] =\n\t\t\t\t\tnumber_format(\n\t\t\t\t\t\t\tmoney_format(\n\t\t\t\t\t\t\t\t\t'%i',\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t$value / $generalall['proved']\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t), 2, '.', ','\n\t\t\t\t\t);\n\t\t\t\t} else if ($key == 'Dias de Promesa') {\n\t\t\t\t\t$result_array[$key] =\n\t\t\t\t\tnumber_format(\n\t\t\t\t\t\t\tmoney_format(\n\t\t\t\t\t\t\t\t\t'%i',\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t$value / $generalall['promise']\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t), 2, '.', ','\n\t\t\t\t\t);\n\t\t\t\t} else if ($key == 'Dias de Pago') {\n\t\t\t\t\t$result_array[$key] =\n\t\t\t\t\tnumber_format(\n\t\t\t\t\t\t\tmoney_format(\n\t\t\t\t\t\t\t\t\t'%i',\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t$value / $generalall['payment']\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t), 2, '.', ','\n\t\t\t\t\t);\n\t\t\t\t} else if ($key == 'Monto') {\n\t\t\t\t\t$result_array[$key] =\n\t\t\t\t\tnumber_format(\n\t\t\t\t\t\t\tmoney_format(\n\t\t\t\t\t\t\t\t\t'%i',\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t), 2, '.', ','\n\t\t\t\t\t);\n\t\t\t\t// } else {\n\t\t\t\t// \t$result_array[$key] =\n\t\t\t\t// \tnumber_format(\n\t\t\t\t// \t\t\tmoney_format(\n\t\t\t\t// \t\t\t\t\t'%i',\n\t\t\t\t// \t\t\t\t\t(\n\t\t\t\t// \t\t\t\t\t\t$value / $general['Cantidad']\n\t\t\t\t// \t\t\t\t\t)\n\t\t\t\t// \t\t\t), 2, '.', ','\n\t\t\t\t// \t);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$result_array[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$performanceGeneral = $result_array;\n\t} else {\n\t\t$performanceGeneral = null;\n\t}\n\n\t// NOTE to concvert need drop al traces of a string\n\t\t$new_monto = str_replace(',','',$performanceGeneral['Monto']);\n\t\t$factor = ( (100) / $new_monto );\n\n\t\tforeach ($performanceReferencesIdx as $key_rfc => $comp_name) {\n\t\t\t$to_parsing[] = json_encode(array('name'=>$comp_name,'y'=>round((array_sum($performanceReferencesResume[$key_rfc]['amount']))*$factor,2),'drilldown'=>$key_rfc), JSON_PRETTY_PRINT);\n\t\t\tforeach ($performanceReferencesResume[$key_rfc]['amount'] as $key_reference => $amount_value) {\n\t\t\t\t$data_x[$key_rfc][$key_reference] = '[\"'.$key_reference.'\",'. $amount_value * $factor . ']' ;\n\t\t\t\t$performanceReferencesResumePercent[$key_rfc]['amount'][$key_reference] = $amount_value * $factor;\n\t\t\t}\n\n\t\t\t$data='['.str_replace('}',']',str_replace('{','[',str_replace(':',',',str_replace(',','],[',json_encode($performanceReferencesResumePercent[$key_rfc]['amount']))))).']';\n\t\t\t$init_parsing[$key_rfc] = json_encode(array('name'=>$comp_name,'id'=>$key_rfc,'data'=>\"{$data}\"), JSON_FORCE_OBJECT);\n\t\t}\n\n\t\t$in_parsing = str_replace(']\"',']',str_replace('\"[','[',str_replace('\\\"','\"',$init_parsing)));\n\t\t$json_parsing_level_one = implode(',',$to_parsing);\n\t\t$json_parsing_level_two = implode(',',$in_parsing);\n\n\t\t// debug($json_parsing_level_two);\n\n// debug($performanceReferencesResume);\n\n\t\t$this->set(compact('performanceReferencesMod','performanceReferencesIdx','dashboard','performanceReferencesResume','performanceGeneral','subgeneral','json_parsing_level_one','json_parsing_level_two'));\n\n\t\t// NOTE set the response output for an ajax call\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoLayout = false;\n\t}",
"public function filter(Request $request){\n $data = $request->all();\n // echo \"<pre>\"; print_r($data); die;\n $colorUrl =\"\";\n if(!empty($data['colorFilter'])){\n foreach ($data['colorFilter'] as $color) {\n if(empty($colorUrl)){\n $colorUrl = \"&color=\".$color;\n }else{\n $colorUrl .= \"-\".$color;\n }\n }\n }\n $sleeveUrl =\"\";\n if(!empty($data['sleeveFilter'])){\n foreach ($data['sleeveFilter'] as $sleeve) {\n if(empty($sleeveUrl)){\n $sleeveUrl = \"&sleeve=\".$sleeve;\n }else{\n $sleeveUrl .= \"-\".$sleeve;\n }\n }\n }\n\n $patternUrl =\"\";\n if(!empty($data['patternFilter'])){\n foreach ($data['patternFilter'] as $pattern) {\n if(empty($patternUrl)){\n $patternUrl = \"&pattern=\".$pattern;\n }else{\n $patternUrl .= \"-\".$pattern;\n }\n }\n }\n\n $sizeUrl =\"\";\n if(!empty($data['sizeFilter'])){\n foreach ($data['sizeFilter'] as $size) {\n if(empty($sizeUrl)){\n $sizeUrl = \"&size=\".$size;\n }else{\n $sizeUrl .= \"-\".$size;\n }\n }\n }\n \n $finalUrl = \"products/\".$data['url'].\"?\".$colorUrl. $sleeveUrl. $patternUrl.$sizeUrl;\n return redirect::to($finalUrl);\n\n }",
"public\n function loanRefinancingFilters(Request $request)\n {\n $belonging_id = 11;\n\n $percentage_types = $request->percentage_types;\n\n $providing_types = $request->providing_types;\n\n $special_project_answers = $request->special_project_answers;\n\n $privileged_term_answers = $request->privileged_term_answers;\n\n $repayment_types = $request->repayment_types;\n\n $repayment_loan_interval_type = $request->repayment_loan_interval_type;\n\n $repayment_percent_interval_type = $request->repayment_percent_interval_type;\n\n $loan_term_search = $request->loan_term_search;\n\n $time_type_search = $request->time_type_search;\n\n $loan_amount = intval($request->loan_amount);\n\n if ($time_type_search == 1 || $time_type_search == \"\" || is_null($time_type_search)) {\n $time_type = 1;\n\n $loan_term_search_in_days = $loan_term_search;\n } else if ($time_type_search == 2) {\n\n $loan_term_search_in_days = $loan_term_search * 30;\n } else if ($time_type_search == 3) {\n\n $loan_term_search_in_days = $loan_term_search * 365;\n }\n\n $prepayment_percent = 0;\n\n if (is_null($providing_types)) {\n $providing_types = ProvidingType::pluck('id')->toArray();\n } else {\n $providing_types = array_merge($providing_types, array(1));\n }\n\n if (is_null($percentage_types)) {\n $percentage_types = PercentageType::pluck('id')->toArray();\n } else {\n $percentage_types = array_merge($percentage_types, array(1));\n }\n\n if (is_null($repayment_types)) {\n $repayment_types = RepaymentType::pluck('id')->toArray();\n } else {\n $repayment_types = array_merge($repayment_types, array(1));\n }\n\n $security_types = $request->security_types;\n\n $products = LoanRefinancing::with('companyInfo')->with(['variations' => function ($q) use ($providing_types, $percentage_types, $repayment_types) {\n $q->whereIn('providing_type', $providing_types);\n $q->whereIn('percentage_type', $percentage_types);\n $q->whereIn('repayment_type', $repayment_types);\n }])\n ->withCount('variations')->has('variations', '>', 0)\n ->whereIn('status', [1, 2, 5]);\n\n if (!is_null($loan_term_search_in_days)) {\n $products->where(function ($query) use ($loan_term_search_in_days) {\n $query->where('loan_term_from_in_days', '<=', (float)$loan_term_search_in_days);\n\n $query->where('loan_term_to_in_days', '>=', (float)$loan_term_search_in_days);\n });\n }\n\n if (!is_null($loan_amount)) {\n $products->where(function ($query) use ($loan_amount) {\n $query->where('loan_amount_from', '<=', (float)$loan_amount);\n });\n\n $products = $products->where(function ($query) use ($loan_amount) {\n $query->where('loan_amount_to', '>=', (float)$loan_amount)\n ->orWhere(function ($query) use ($loan_amount) {\n $query->where('loan_amount_to', '=', 0);\n });\n });\n }\n\n if (is_array($repayment_types) && count($repayment_types) > 0) {\n $products->where(function ($query) use ($repayment_types) {\n $query->whereIn('repayment_type', $repayment_types);\n });\n }\n\n if (is_array($percentage_types) && count($percentage_types) > 0) {\n $products->where(function ($query) use ($percentage_types) {\n $query->whereIn('percentage_type', $percentage_types);\n });\n }\n\n if (is_array($providing_types) && count($providing_types) > 0) {\n $products->whereHas('variations', function ($q) use ($providing_types) {\n $q->whereIn('providing_type', $providing_types);\n });\n }\n\n if (is_array($security_types) && count($security_types) > 0) {\n $products->whereHas('securityTypes', function ($q) use ($security_types) {\n $q->whereIn('security_type', $security_types);\n });\n }\n\n if (is_array($privileged_term_answers) && count($privileged_term_answers) > 0) {\n if (in_array(2, $privileged_term_answers)) {\n $products->where(function ($query) use ($privileged_term_answers) {\n $query->whereIn('privileged_term', $privileged_term_answers);\n $query->orWhereNull('privileged_term');\n });\n } else {\n $products->where(function ($query) use ($privileged_term_answers) {\n $query->whereIn('privileged_term', $privileged_term_answers);\n });\n }\n }\n\n if (is_array($special_project_answers) && count($special_project_answers) > 0) {\n if (in_array(2, $special_project_answers)) {\n $products->where(function ($query) use ($special_project_answers) {\n $query->where('special_projects', 0);\n $query->orWhereNull('special_projects');\n });\n } else {\n $products->where(function ($query) use ($special_project_answers) {\n $query->whereIn('special_projects', $special_project_answers);\n });\n }\n }\n\n $products = $products->get();\n\n $productsWithVariations = [];\n\n $productsWithVariationsGroupByCompany = [];\n\n $request_results_count = 0;\n\n foreach ($products as $product) {\n\n $request_results_count = $request_results_count + $product->variations->count();\n\n $productsWithVariationsCurr = [];\n\n $productsWithVariationsCurr[\"id\"] = $product->id;\n\n $productsWithVariationsCurr[\"name\"] = $product->name;\n\n $productsWithVariationsCurr[\"company_id\"] = $product->company_id;\n\n $productsWithVariationsCurr[\"companyInfo\"] = $product->companyInfo;\n\n $curr_variations = [];\n\n if (intval($product->loan_pledge_ratio) == 0) {\n $cost = 0;\n } else {\n $cost = 100 * $loan_amount / $product->loan_pledge_ratio;\n }\n\n foreach ($product->variations as $product_variation) {\n\n $curr_variation = [];\n\n $getCalculation = $this->getCalculation($product, $product_variation, $cost, $loan_amount, $loan_term_search, $loan_term_search_in_days, $prepayment_percent, $time_type_search);//calculate factual_percentage and other\n\n if (is_numeric($getCalculation[\"xirr\"])) {\n\n $factual_percentage = 100 * $getCalculation[\"xirr\"];\n\n $require_payments = $getCalculation[\"require_payments\"];\n\n $sum_payments = $getCalculation[\"sum_payments\"];\n\n $curr_variation[\"id\"] = $product_variation->id;\n\n $curr_variation[\"product_id\"] = $product->id;\n\n $curr_variation[\"providing_type\"] = $product_variation->providing_type;\n\n $curr_variation[\"percentage_type\"] = $product_variation->percentage_type;\n\n $curr_variation[\"percentage\"] = $product_variation->percentage;\n\n $curr_variation[\"repayment_type\"] = $product_variation->repayment_type;\n\n $curr_variation[\"repayment_loan_interval_type_id\"] = $product_variation->repayment_loan_interval_type_id;\n\n $curr_variation[\"repayment_percent_interval_type_id\"] = $product_variation->repayment_percent_interval_type_id;\n\n $curr_variation[\"factual_percentage\"] = $factual_percentage;\n\n $curr_variation[\"require_payments\"] = number_format(round($require_payments), 0, \",\", \" \");\n\n $curr_variation[\"sum_payments\"] = number_format(round($sum_payments), 0, \",\", \" \");\n\n $unique_options = \"bel_\" . $belonging_id . \"_prod_\" . $product->id . \"_prov_\" . $product_variation->providing_type . \"_perc_\" .\n $product_variation->percentage_type . \"_rep_\" . $product_variation->repayment_type . \"_rep_loan_\" .\n intval($product_variation->repayment_loan_interval_type_id) . \"_rep_perc_\" . intval($product_variation->repayment_percent_interval_type_id);\n\n $unique_options = md5($unique_options);\n\n $curr_variation[\"unique_options\"] = $unique_options;\n\n $curr_variations[$product_variation->id] = $curr_variation;\n\n\n $productsWithVariationsGroupByCompanyCurr = $curr_variation;\n\n $productsWithVariationsGroupByCompanyCurr[\"name\"] = $product->name;\n\n $productsWithVariationsGroupByCompanyCurr[\"company_id\"] = $product->company_id;\n\n $productsWithVariationsGroupByCompanyCurr[\"companyInfo\"] = $product->companyInfo;\n\n $productsWithVariationsGroupByCompany[] = $productsWithVariationsGroupByCompanyCurr;\n }\n }\n\n $curr_variations = $this->arrayMultisort($curr_variations, \"factual_percentage\");\n\n $productsWithVariationsCurr[\"variations\"] = $curr_variations;\n\n $min_factual_percentage = count($curr_variations) > 0 ? min(array_column($curr_variations, 'factual_percentage')) : null;\n\n $productsWithVariationsCurr[\"min_factual_percentage\"] = $min_factual_percentage;\n\n $productsWithVariations[] = $productsWithVariationsCurr;\n }\n\n $productsWithVariations = collect($productsWithVariations)->sortBy('min_factual_percentage');\n\n $productsWithVariations = $this->paginateCollection($productsWithVariations, $this->per_page);\n\n $productsWithVariationsGroupByCompany = $this->arrayMultisort($productsWithVariationsGroupByCompany, \"factual_percentage\");\n\n $productsWithVariationsGroupByCompany = collect($productsWithVariationsGroupByCompany)->groupBy('company_id');\n\n $productsWithVariationsGroupByCompany = $this->paginateCollection($productsWithVariationsGroupByCompany, $this->per_page, 'page_by_company');\n\n\n $links = (String)$productsWithVariations->appends([])->links('pagination::bootstrap-4');\n\n $links_grouped_by_company = (String)$productsWithVariationsGroupByCompany->appends([])->links('pagination::bootstrap-4');\n\n $getCompareInfo = $this->getCompareInfo();\n\n $checked_variations = $getCompareInfo[$belonging_id][\"checked_variations\"];\n\n return response()->json(\n [\n \"belonging_id\" => $belonging_id,\n \"request_results_count\" => $request_results_count,\n \"productsWithVariations\" => $productsWithVariations,\n \"productsWithVariationsGroupByCompany\" => $productsWithVariationsGroupByCompany,\n 'links' => $links,\n 'links_grouped_by_company' => $links_grouped_by_company,\n 'checked_variations' => $checked_variations\n ]\n );\n }",
"public function filterData(&$object, $filters, $varPrefix=''){\n foreach($object as $property => $value){\n $filter = $filters[$property];\n $fieldName = $varPrefix . $property;\n if(self::FILTER_CLASS == $filter->filter){\n $clzName = $filter->clzName;\n $obj = new $clzName;\n $this->filterData($obj, $filter->filterTypes , $fieldName.'_');\n $object->$property = $obj;\n }else{\n $getData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName);\n $origData = is_string($getData) ? ($getData) : $getData;\n //$origData = trim(DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName));\n if(empty($origData)){\n if(!$filter->isnull){\n //$this->action->addError($property, sprintf(self::ERROR_ISNULL, $filter->label));\n $this->action->addError($property, $this->genMsgContent(self::ERROR_ISNULL, $filter->label));\n }\n if(strlen($origData) > 0)\n {\n $object->$property = $origData;\n }\n continue;\n }\n elseif (is_array($origData))\n {\n $null_flag = false;\n if (!$filter->isnull)\n {\n if ($filter->filter == self::FILTER_NUMBER)\n {\n if(array_sum($origData) == 0) \n {\n $this->action->addError($property, $this->genMsgContent(self::ERROR_ISNULL, $filter->label));\n $null_flag = true;\n }\n }\n else\n {\n foreach ($origData as $single_null)\n {\n if (empty($single_null))\n {\n $this->action->addError($property, $this->genMsgContent(self::ERROR_ISNULL, $filter->label));\n $null_flag = true;\n $object->$property = $origData;\n break;\n }\n }\n }\n }\n else\n {\n //when filter datetime include of two part\n if ($filter->filter == self::FILTER_DATETIME)\n {\n $null_arr = array();\n foreach ($origData as $single_null)\n {\n if ($single_null == '')\n {\n $null_arr[] = 1;\n }\n else\n {\n $null_arr[] = 0;\n }\n }\n //two part all is null\n if (array_sum($null_arr) == 2){\n $null_flag = true;\n }\n elseif (array_sum($null_arr) == 1){\n $this->action->addError($property, $this->genMsgContent(self::ERROR_ISNULL, $filter->label));\n $null_flag = true;\n $object->$property = $origData;\n }\n }\n }\n if ($null_flag) continue;\n }\n $object->$property = $origData;\n if ($filter->maxLength != 0)\n {\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName);\n if (is_array($fillData))\n {\n $max_length_flag = false;\n foreach ($fillData as $single)\n {\n if (mb_strlen($single, 'UTF-8') > $filter->maxLength)\n {\n $this->action->addError($property, $this->genMsgContent(self::ERROR_MAX_LENGTH, $filter->label));\n $max_length_flag = true;\n break;\n }\n }\n if ($max_length_flag) continue;\n }\n elseif (mb_strlen($fillData,'UTF-8') > $filter->maxLength)\n {\n $this->action->addError($property, $this->genMsgContent(self::ERROR_MAX_LENGTH, $filter->label));\n continue;\n }\n }\n switch($filter->filter){\n case self::FILTER_DATE:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_DATE);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_NUMBER);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_DATE, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_DATETIME:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_DATETIME);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_NUMBER);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_DATETIME, $filter->label));\n }\n else{\n $object->$property = is_array($fillData) ? implode(' ', $fillData) : $fillData;\n }\n break;\n case self::FILTER_NUMBER:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_NUMBER);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_NUMBER);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_NUMBER, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_POSITIVE_NUMBER:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_POSITIVE_NUMBER);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_NUMBER);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_POSITIVE_NUMBER, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_EMAIL:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_EMAIL);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_EMAIL);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_EMAIL, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_URL:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_URL);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_URL);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_URL, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_HTML:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_HTML);\n if(!$fillData){\n //$this->action->addError($property, self::ERROR_HTML);\n $this->action->addError($property, $this->genMsgContent(self::ERROR_HTML, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_STRING_NUMBER:\n $fillData = DefaultHttpInputValidation::getDate(HttpConst::TYPE_REQUEST, $fieldName, HttpConst::FILTER_STRING_NUMBER);\n if(!$fillData){\n $this->action->addError($property, $this->genMsgContent(self::ERROR_STRING_NUMBER, $filter->label));\n }\n else{\n $object->$property = $fillData;\n }\n break;\n case self::FILTER_STRING:\n default:\n break;\n }\n }\n }\n }",
"public function modelAttributes($request)\n\t{\n\t\t\n\t\t$filter = json_decode($request->filter);\n\n\t\t\n\t\tif(isset($filter) && isset($filter->amountAvailable)){\n\t\t\treturn [];\n\t\t}else{\n\t\t\treturn [\n\t\t 'statusName' => $this->statusName,\n\t\t ]; \t\n\t\t}\n\t\t \n\t}",
"public function dataQualityAction(Request $request)\n {\n $form = $this->createForm(ReportFilterType::class, null, ['site_type'=>'advanced']);\n $service = $this->get('ns_sentinel.ibd_report');\n $params = $service->getDataQuality($request, $form, 'reportIBDDataQuality');\n if ($params instanceof Response) {\n return $params;\n }\n\n return $this->render('NSSentinelBundle:Report/IBD:dataQuality.html.twig', $params);\n }",
"function get_prod_diffs($diffID, $active_filters, $parent_value, $category_value, $u_joint_type_value) {\n global $wpdb;\n\n $diff_where_value = '';\n $diff_where_data = [$diffID];\n if( count($active_filters) !== 0 ) {\n foreach($active_filters as $filter_value) {\n // First, make sure the filter has a value then add to where statement\n if ($filter_value === 'year') {\n $diff_where_value .= ' AND startyear <= %d AND endyear >= %d';\n $diff_where_data[] = $_GET['year'];\n $diff_where_data[] = $_GET['year'];\n } elseif ($filter_value == 'GearRatio') {\n $diff_where_value .= \" AND find_in_set(%s, replace(GearRatio, ', ', ',')) <> 0\";\n $diff_where_data[] = $_GET[$filter_value];\n } else {\n $diff_where_value .= ' AND ' . $filter_value . ' = %s';\n $diff_where_data[] = $_GET[$filter_value];\n }\n }\n }\n\n // If U-joint Type value is Conversion enable tertiary_filters\n if( $u_joint_type_value === 'Conversion') {\n\n $select = \"diffid, diffname, diffdescription, diffimage, \"\n . implode(', ', tertiary_filter::FILTER_ARRAY). ', '\n . implode(', ', secondary_filter::FILTER_ARRAY). ', '\n . implode(', ', filter::FILTER_ARRAY);\n\n // If Parent or Category value matches one of our filter_activation items enable secondary_filters\n } elseif( in_array($parent_value, filter_activations::VALUES_ARRAY) ||\n in_array($category_value, filter_activations::VALUES_ARRAY)) {\n\n $select = \"diffid, diffname, diffdescription, diffimage, \"\n . implode(', ', secondary_filter::FILTER_ARRAY). ', '\n . implode(', ', filter::FILTER_ARRAY);\n\n } else {\n\n $select = \"diffid, diffname, diffdescription, diffimage, \"\n . implode(', ', filter::FILTER_ARRAY);\n\n }\n\n // Query up the rows\n $query = $wpdb->prepare(\"SELECT DISTINCT \" . $select . \" FROM randys_advancedsearch WHERE DiffID = %d \" . $diff_where_value, $diff_where_data); // WPCS: unprepared SQL OK\n $results = $wpdb->get_results($query); // WPCS: unprepared SQL OK\n\n // Return the differential that matches the queried information\n return $results;\n}",
"public function formCriteriaParams()\n\t{\n\t\t//fetch data from profile index\n\t}",
"public function index(HTTPRequest $request)\n {\n $client = $request->getVar('Client') ?: 'MySQL';\n $properties = $this->createSearch($request->getVar('Keywords'), 'Properties', $client);\n\n if ($arrival = $request->getVar('ArrivalDate')) {\n $arrivalStamp = strtotime($arrival);\n $nightAdder = '+'.$request->getVar('Nights').' days';\n $startDate = date('Y-m-d', $arrivalStamp);\n $endDate = date('Y-m-d', strtotime($nightAdder, $arrivalStamp));\n $properties->filter([\n 'AvailableStart:LessThanOrEqual' => $startDate,\n 'AvailableEnd:GreaterThanOrEqual' => $endDate\n ]);\n\n }\n\n $filters = [\n ['Bedrooms', 'Bedrooms', 'GreaterThanOrEqual'],\n ['Bathrooms', 'Bathrooms', 'GreaterThanOrEqual'],\n ['MinPrice', 'PricePerNight', 'GreaterThanOrEqual'],\n ['MaxPrice', 'PricePerNight', 'LessThanOrEqual'],\n ];\n\n foreach($filters as $filterKeys) {\n list($getVar, $field, $filter) = $filterKeys;\n if ($value = $request->getVar($getVar)) {\n $properties->filter([\n \"{$field}:{$filter}\" => $value\n ]);\n }\n }\n\n if ($regionIds = $request->getVar('RegionID')) {\n $properties->filter('RegionID', $regionIds);\n }\n\n $results = $properties->fetch();\n //Optional: for demonstration only\n $this->rawQuery = $properties->sql();\n\n return [\n 'Results' => $results\n ];\n }",
"function returnShortPropertyList(){\n\n loginDB();\n\n global $db;\n global $SearchResults;\n\n\t\t$query = \"SELECT * FROM Properties\";\n\n\t\t\n\t\tif (!empty($_GET['Suburb'])){\n\t\t\t$query .= \" WHERE suburb LIKE '%{$_GET['Suburb']}%'\";\n\t\t}\n\t\t\n\t\tif (!empty($_GET['Bed'])){\n\t\t\tstrlen ($query ) > 24 ? $query .= ' AND ' : $query .= ' WHERE ';\n\t\t\t$query .= \"bed = '{$_GET['Bed']}'\";\n\t\t}\t\n\n\t\tif (!empty($_GET['Bath'])){\n\t\t\tstrlen ($query ) > 24 ? $query .= ' AND ' : $query .= ' WHERE ';\n\t\t\t$query .= \"bath = '{$_GET['Bath']}'\";\n\t\t}\n\n\t\tif (!empty($_GET['Car'])){\n\t\t\tstrlen ($query ) > 24 ? $query .= ' AND ' : $query .= ' WHERE ';\n\t\t\t$query .= \"car = '{$_GET['Car']}'\";\n\t\t}\n\n\t\tif (!empty($_GET['minWeeklyRent'])){\n\t\t\tstrlen ($query ) > 24 ? $query .= ' AND ' : $query .= ' WHERE ';\n\t\t\t$query .= \"weeklyRent >= '{$_GET['minWeeklyRent']}'\";\n\t\t}\t\t\n\t\t\n\t\tif (!empty($_GET['maxWeeklyRent'])){\n\t\t\tstrlen ($query ) > 24 ? $query .= ' AND ' : $query .= ' WHERE ';\n\t\t\t$query .= \"weeklyRent <= '{$_GET['maxWeeklyRent']}'\";\n\t\t}\t\n\t\t//for return all properties\n\t\tif (!empty($_GET['searchParam'])){\n\t\t\t$query = \"SELECT * FROM Properties\";\n\t\t}\n\t\t// Gumtree ID search over-rides other parameters\n\t\tif (!empty($_GET['gumTreeId'])){\n\t\t\t$query = \"SELECT * FROM Properties\";\n\t\t}\t\t\n \n mysqli_query($db, $query) or die('Error querying database.');\n\n $queryResult = mysqli_query($db, $query);\n\n $ResultCount = 0;\n $SearchResults = array (\n array(\"uniqueCode\"),\n array(\"address\"),\n array(\"suburb\"),\n array(\"postcode\"),\n array(\"bed\"),\n array(\"bath\"),\n array(\"car\"),\n array(\"description\"),\n array(\"image\")\n );\n\n $xyz = 0;\n while ($row = $queryResult->fetch_assoc()) {\n \n $SearchResults[$xyz][0] = $row['uniqueCode'];\n $SearchResults[$xyz][1] = $row['address'];\n $SearchResults[$xyz][2] = $row['suburb'];\n $SearchResults[$xyz][3] = $row['postcode'];\n $SearchResults[$xyz][4] = $row['bed'];\n $SearchResults[$xyz][5] = $row['bath'];\n $SearchResults[$xyz][6] = $row['car'];\n $SearchResults[$xyz][7] = $row['description'];\n $SearchResults[$xyz][8] = $row['image'];\n\t\t\t//---added\n\t\t\t$SearchResults[$xyz][9] = $row['weeklyRent'];\n//--\n $ResultCount++;\n $xyz++;\n }\n\n if(empty($queryResult)){\n echo \"<br><br>Sorry, there were no results that matched your search.<br>Please try again with different search parameters.\";\n } else {\n if (!$_GET['searchParam'] == \"*\"){\n echo \"<div class='NumSearchResults'>Returned \" . $ResultCount . \" result(s) for \" . $_GET['searchValue'] . \" ordered by: \" . $_GET['searchParam'] . \".</div><br><br>\";\n } else {\n echo \"<div class='NumSearchResults'>Showing all properties.</div><br><br>\";\n }\n /*\n The below code basically generates a table for each search result that comes back.\n Personally I hate the way this code looks, and I don't like how everything isn't\n tabulated or anything. It looks like shit frankly but for the moment there's\n no other way I can think to do this.\n\n So programatically what is actually happening is this:\n > We have one variable, TableToPrint, and it's getting cycled through, with\n little pieces of the table HTML being added on, and in between the PHP variables\n are being printed out. At the end this TableToPrint is added onto another variable,\n TablesToPrint. \n > When TablesToPrint is finished, then it is printed and that will be our search results.\n */\n\n $TableToPrint = \"\";\n $TablesToPrint = \"\";\n\n for($i = 0; $i < $xyz; $i++){\n $TableToPrint = \"\";\n $TableToPrint = $TableToPrint . \"<table class='SmallPropertyListing'><tr><th colspan='3' >Unique Property Code: \";\n\n $TableToPrint = $TableToPrint . $SearchResults[$i][0];\n $TableToPrint = $TableToPrint . \"<tr><th colspan='3'>Address: \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][1];\n $TableToPrint = $TableToPrint . \"</th></tr><tr><td colspan='2'><b>Suburb:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][2];\n $TableToPrint = $TableToPrint . \"</td><td><b>Post Code:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][3];\n $TableToPrint = $TableToPrint . \"</td></tr><tr><td><b>Beds:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][4];\n $TableToPrint = $TableToPrint . \"</td><td><b>Baths:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][5];\n $TableToPrint = $TableToPrint . \"</td><td><b>Cars:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][6];\n $TableToPrint = $TableToPrint . \"</td></tr><tr><td colspan='2' rowspan='4'><b>Description:</b><br>\";\n $TableToPrint = $TableToPrint . $SearchResults[$i][7];\n\t\t\t\t\n\t\t\t\t\n//--added\n $TableToPrint = $TableToPrint . \"</td><td><b>Weekly Rent:</b> \";\n $TableToPrint = $TableToPrint . $SearchResults[$i][9];\n\n//--\n\n /* Handling the photo here. */\n $ImageAddress = $SearchResults[$i][8];\n if ($ImageAddress == \"\"){\n $TableToPrint = $TableToPrint . \"</td><td rowspan='3'><b>Photo missing.</b><br><img src='images/pingu.jpg' class='SolidBorder'>\"; \n } else {\n $TableToPrint = $TableToPrint . \"</td><td rowspan='3'><b>Photo:</b><br><img src=images/\" . $SearchResults[$i][8] . \" class='SolidBorder'>\";\n }\n \n $TableToPrint = $TableToPrint . \"</td></tr><tr></tr><tr></tr><tr><td><a href=propertylisting.php?id=\" . $SearchResults[$i][0] . \">More Information</a>\";\n $TableToPrint = $TableToPrint . \"</td></tr></table><br><br>\";\n\n $TablesToPrint = $TablesToPrint . $TableToPrint;\n }\n echo $TablesToPrint;\n }\n mysqli_close($db);\n }",
"function get_diff_prod_filters($differentials, $active_filters, $diffIDSelected, $parent_value, $category_value, $u_joint_type_value) {\n global $wpdb;\n\n // Stores all the found filters as 'filter' => array('value1', 'value2', 'value3')\n $found_filters = array();\n\n // If Conversion is selected U-joint type enable tertiary filters\n if( $u_joint_type_value === 'Conversion') {\n\n $filter_list = array_merge_recursive(\n tertiary_filter::FILTER_ARRAY,\n secondary_filter::FILTER_ARRAY,\n filter::FILTER_ARRAY\n );\n\n } elseif( in_array($parent_value, filter_activations::VALUES_ARRAY) ||\n in_array($category_value, filter_activations::VALUES_ARRAY)) {\n\n $filter_list = array_merge(secondary_filter::FILTER_ARRAY, filter::FILTER_ARRAY);\n\n } else {\n $filter_list = filter::FILTER_ARRAY;\n }\n\n // Loop through each of the possible filters\n foreach ($filter_list as $key => $filter) {\n // We will keep an array of all found values\n $found_values = array();\n // Go through each of the differentials to add up the values\n foreach ($differentials as $diff) {\n // If the value isn't present\n if (!in_array($diff->$filter, $found_values) && ($diff->$filter !== '') && ($diff->$filter !== null)) {\n $found_values[] = $diff->$filter;\n }\n }\n rsort($found_values);\n\n\n if ( $key === 'Sub Category' || count($found_values) >= 2 || in_array($filter, $active_filters) ) {\n $found_filters[] = array(\n 'label' => $key,\n 'value' => $filter,\n 'data' => $found_values,\n );\n }\n }\n\n\n // Get the 'Spline Count' of the current Diff\n $diff_spline = $wpdb->get_row(\n $wpdb->prepare(\n \"SELECT SplineCount From randys_differential WHERE DifferentialID = %d\",\n $diffIDSelected\n )\n );\n\n foreach( $found_filters as $key => $filters ) {\n\n // Many Gear Ratio items return multiple values in a string.\n // Break them into own value, and update $found_filters array\n if( $filters['label'] === 'Gear Ratio') {\n $gear_ratio_arr = '';\n $ratios_arr = array();\n // Once Gear Ratio is found loop through each item\n foreach( $filters['data'] as $gear_item ) {\n\n if( strpos($gear_item, ',') ) {\n // If a string has multiple values, break into own value\n $items = explode(', ', $gear_item);\n $ratios_arr = array_merge($items, $ratios_arr);\n } else {\n // Otherwise just add it to the array\n $ratios_arr[] = $gear_item;\n }\n\n // Sort, remove dupliates, and remove empty values\n rsort($ratios_arr);\n $unique_arr = array_unique($ratios_arr);\n $gear_ratio_arr = array_diff( $unique_arr, array( '' ) );\n $gear_ratio_arr = array_values($gear_ratio_arr);\n }\n\n // Send updated information back to $found_filters array\n $found_filters[$key]['data'] = $gear_ratio_arr;\n\n }\n\n\n // Handle format of how spline count is being outputted\n if( $filters['label'] === 'Spline Count' && $diff_spline ) {\n // Once Spline Count is found loop through each item\n foreach( $filters['data'] as $spline_item ) {\n if( $spline_item === $diff_spline->SplineCount ) {\n // If spline count is stock\n $stock_spline = 'Stock Spline (' . $spline_item . ' Splines)';\n } else {\n // Otherwise format non-stock output\n $spline_numbers_arr[] = $spline_item;\n sort($spline_numbers_arr);\n $last_spline = array_slice($spline_numbers_arr, -1);\n $first_spline = join(', ', array_slice($spline_numbers_arr, 0, -1));\n $all_splines = array_filter(array_merge(array($first_spline), $last_spline), 'strlen');\n $non_stock_spline = 'NON-Stock Spline (' . join(', & ', $all_splines) . ' Splines)';\n }\n\n }\n\n $spline_arr = [];\n if( isset($stock_spline ) ) {\n $spline_arr[] = $stock_spline;\n }\n if( isset( $non_stock_spline) ) {\n $spline_arr[] = $non_stock_spline;\n }\n\n // Send updated information back to $found_filters array\n $found_filters[$key]['data'] = $spline_arr;\n }\n\n }\n\n return $found_filters;\n}",
"protected function extractProperties(Request $request)\n {\n $filter = $request->query->get('filter', []);\n if (array_key_exists($this->parameter, $filter)) {\n return $filter[$this->parameter];\n }\n\n return [];\n }",
"static public function wpp_get_search_filters( $filter ) {\n global $wpdb, $wpp_property_import;\n\n $schedules = $wpdb->get_col( \"\n SELECT distinct meta_value\n FROM {$wpdb->postmeta}\n WHERE meta_key = 'wpp_import_schedule_id'\n \" );\n\n $values = array();\n if(\n !empty( $schedules ) &&\n !empty( $wpp_property_import[ 'schedules' ] ) &&\n is_array( $wpp_property_import[ 'schedules' ] )\n ) {\n foreach( $wpp_property_import[ 'schedules' ] as $k => $data ) {\n if( in_array( $k, $schedules ) ) {\n $values[ $k ] = $data[ 'name' ];\n }\n }\n }\n\n if ( !empty( $values ) ) {\n\n /* Add filter by XML Schedules */\n $filter[ 'wpp_import_schedule_id' ] = array (\n 'type' => 'multi_checkbox',\n 'label' => __( 'Importer',ud_get_wpp_importer()->domain ),\n 'values' => $values\n );\n\n /* Maybe Add filter by Manual/Imported Properties */\n\n $mtotal = $wpdb->get_var( \"\n SELECT count( ID )\n FROM {$wpdb->posts}\n WHERE ID NOT IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = 'wpp_import_schedule_id' )\n AND post_type = 'property'\n AND post_status != 'auto-draft'\n \" );\n\n $itotal = $wpdb->get_var( \"\n SELECT count( p.ID )\n FROM {$wpdb->posts} AS p\n LEFT JOIN {$wpdb->postmeta} AS pm ON pm.post_id = p.ID\n WHERE p.post_type = 'property'\n AND p.post_status != 'auto-draft'\n AND pm.meta_key = 'wpp_import_schedule_id'\n \" );\n\n /* Be sure we have manual AND imported properties. In other case, it does not make sense to show filter. */\n if( !empty( $mtotal ) && !empty( $itotal ) ) {\n\n $filter[ '_custom_filter_created_type' ] = array(\n 'type' => 'multi_checkbox',\n 'label' => __( 'Created',ud_get_wpp_importer()->domain ),\n 'values' => array(\n 'manual' => sprintf( __( 'Manually (%s)', ud_get_wpp_importer()->domain ), number_format( $mtotal ) ),\n 'xmli' => sprintf( __( 'Imported via Schedule (%s)', ud_get_wpp_importer()->domain ), number_format( $itotal ) ),\n )\n );\n\n }\n\n }\n\n return $filter;\n\n }",
"function pardot_query_prospect($params = null, $config = null) {\n return pardot_query('prospect', $params, $config);\n}",
"function rest_api_filter_fields_magic( $data, $post, $request ){\n // Get the parameter from the WP_REST_Request\n // This supports headers, GET/POST variables.\n // and returns 'null' when not exists\n $fields = $request->get_param('fields');\n if($fields){\n\n // Create a new array\n $filtered_data = array();\n\n // Explode the $fields parameter to an array.\n $filter = explode(',',$fields);\n\n // If the filter is empty return the original.\n if(empty($filter) || count($filter) == 0)\n return $data;\n\n\n // The original data is in $data object in the property data\n // Foreach property inside the data, check if the key is in the filter.\n foreach ($data->data as $key => $value) {\n //echo $key;\n // If the key is in the $filter array, add it to the $filtered_data\n // original\n /*\n if (in_array($key, $filter)) {\n $filtered_data[$key] = $value;\n }\n */\n //echo $filter;\n \n if (in_array($key, $filter)) {\n\n switch ($key) {\n case \"acf\": {\n // need a case wher I didnt call for anything within acf fields.\n $acf = $data->data[\"acf\"];\n //echo $acf;\n\n foreach ($acf as $key_acf => $value_acf) {\n // echo $value_acf;\n if (in_array($key_acf, $filter)) {\n $filtered_data[\"acf\"][$key_acf] = $value_acf;\n }\n \n }\n }\n break;\n default:\n $filtered_data[$key] = $value;\n }\n\n\n /*\n if ($key == \"acf\") {\n // once it comes here it only hits once.\n $acf = $data->data[\"acf\"];\n //echo $acf;\n\n foreach ($acf as $key_acf => $value_acf) {\n // echo $value_acf;\n if (in_array($key_acf, $filter)) {\n $filtered_data[\"acf\"][$key_acf] = $value_acf;\n }\n \n }\n }\n else {\n $filtered_data[$key] = $value;\n }\n */\n\n \n \n \n }\n \n\n }\n\n }\n\n // return the filtered_data if it is set and got fields.\n return (isset($filtered_data) && count($filtered_data) > 0) ? $filtered_data : $data;\n\n}",
"public function filter(Request $request){ \n \n if($request->priceMin!=null and $request->priceMax!=null and $request->year!=null){\n $produit=Stock::where('stockName',$request->name)\n ->whereBetween('stockPrice', array($request->priceMin, $request->priceMax))\n ->where('stockYear',$request->year)\n ->select('stockName','stockYear','stockPrice','id')\n ->get();}\n elseif($request->priceMin!=null and $request->priceMax!=null and $request->year==null){\n $produit=Stock::where('stockName',$request->name)\n ->whereBetween('stockPrice', array($request->priceMin, $request->priceMax))\n ->select('stockName','stockYear','stockPrice','id')\n ->get();\n }\n elseif ($request->priceMin!=null){\n $produit=Stock::where('stockName',$request->name)\n ->where('stockPrice','>=',$request->priceMin)\n ->select('stockName','stockYear','stockPrice','id')\n ->get();\n }\n elseif ($request->priceMax!=null){\n $produit=Stock::where('stockName',$request->name)\n ->where('stockPrice','<=',$request->priceMax)\n ->select('stockName','stockYear','stockPrice','id')\n ->get();\n }\n \n elseif($request->priceMin==null and $request->priceMax==null and $request->year!=null){\n $produit=Stock::where('stockName',$request->name)\n ->where('stockYear',$request->year)\n ->select('stockName','stockYear','stockPrice','id')\n ->get();\n }\n \n else{\n $produit=Stock::where('stockName',$request->name)\n ->select('stockName','stockYear','stockPrice','id')\n ->get();\n }\n return response()->json($produit);\n }"
] | [
"0.6170438",
"0.5686966",
"0.55297154",
"0.5404913",
"0.5376264",
"0.53409755",
"0.52922016",
"0.52907825",
"0.5277479",
"0.52722615",
"0.52698666",
"0.52635217",
"0.521588",
"0.50515217",
"0.5042932",
"0.50377923",
"0.5022692",
"0.50212514",
"0.50105834",
"0.50019836",
"0.49911806",
"0.49870998",
"0.4986765",
"0.49866414",
"0.4985166",
"0.4984576",
"0.49801612",
"0.49701974",
"0.49500498",
"0.494015"
] | 0.7648249 | 0 |
// |route: /api/shortlist/checkout |postdata: | sectors : json_encode of filter API | public function shortlistCheckoutAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$postdata = $request->request->all();
$user = $this->get('security.context')->getToken()->getUser();
$userId = $user->getId();
$status = 'fail';
$message = 'Nothing to checkout.';
if (!isset($postdata['sectors'])) $postdata['sectors'] = 0;
if($postdata['sectors'] !== 0) {
$sectors = json_decode($postdata['sectors']);
$sector_list = $em->getRepository('RefiBundle:Transactions')->fetchSectorsInListByClientId($userId);
$temp_sectors = array();
foreach($sector_list as $val) {
$temp_sectors[] = $val['sectorCode'];
}
$sector_count = count($temp_sectors);
$ctr = 0;
if($sector_count >= 3) {
$status = 'fail';
$message = 'You already have 3 sectors in your list.';
} else {
foreach($sectors as $key => $sector) {
if(($sector_count + $ctr) == 3) {
break;
} else {
$sector_code = $sector->sector;
for($x = 1; $x < 10; $x++) {
if($sector_code == $x) {
$sector_code = "0" . $x;
}
}
if(!in_array($sector_code, $temp_sectors)) {
$sectorlist = new Sectorlist();
$sectorlist->setClientId($userId);
$sectorlist->setSectorCode($sector_code);
$sectorlist->setDateadded(date('Y-m-d'));
$sectorlist->setValidity($sector->validity);
$em->persist($sectorlist);
$em->flush();
$em->clear();
$ctr++;
}
}
}
$status = 'ok';
$message = 'Checked out!';
}
}
$msg = array('status' => $status, 'message' => $message);
$response = new Response(json_encode($msg));
if($status == 'fail') {
$response->setStatusCode(Response::HTTP_BAD_REQUEST);
} else {
$response->setStatusCode(Response::HTTP_OK);
}
$response->headers->set('Content-Type', 'application/json');
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllsectors(Request $request){\n $sector = Sector::get(['id', 'sector as text']);\n return response()->json($sector);\n }",
"function careerfy_vc_employer_listing()\n{\n global $jobsearch_plugin_options;\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n $sectors_enable_switch = isset($jobsearch_plugin_options['sectors_onoff_switch']) ? $jobsearch_plugin_options['sectors_onoff_switch'] : 500;\n\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n $emp_listsh_parms = [];\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"View\", \"careerfy-frame\"),\n 'param_name' => 'employer_view',\n 'value' => array(\n esc_html__(\"Style 1\", \"careerfy-frame\") => 'view-default',\n esc_html__(\"Style 2\", \"careerfy-frame\") => 'view-grid',\n esc_html__(\"Style 3\", \"careerfy-frame\") => 'view-slider',\n ),\n 'description' => esc_html__(\"Select employers listing view.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'employer_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Locations in listing\", \"careerfy-frame\"),\n 'param_name' => 'employer_loc_listing',\n 'value' => array(\n esc_html__(\"Country\", \"careerfy-frame\") => 'country',\n esc_html__(\"State\", \"careerfy-frame\") => 'state',\n esc_html__(\"City\", \"careerfy-frame\") => 'city',\n ),\n 'std' => 'country,city',\n 'description' => esc_html__(\"Select which type of location in listing. If nothing select then full address will display.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Employer Founds with display counts\", \"careerfy-frame\"),\n 'param_name' => 'display_per_page',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Display the per page empoyers count at top of the listing.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Employers searching filters switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Count\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_count',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Sort by\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_sortby',\n 'value' => array(\n esc_html__(\"Default\", \"careerfy-frame\") => 'default',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'asc',\n esc_html__(\"Descending\", \"careerfy-frame\") => 'desc',\n esc_html__(\"Alphabetical\", \"careerfy-frame\") => 'alpha',\n esc_html__(\"Highest Count\", \"careerfy-frame\") => 'count',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_loc',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Employers searching filters 'Location' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_loc_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations Filter Style\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_loc_view',\n 'value' => array(\n esc_html__(\"Checkbox List\", \"careerfy-frame\") => 'checkboxes',\n esc_html__(\"Dropdown Fields\", \"careerfy-frame\") => 'dropdowns',\n esc_html__(\"Input Field\", \"careerfy-frame\") => 'input',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_date',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Employers searching filters 'Date Posted' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted Collapse\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_date_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Employers searching filters 'Sector' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_sector_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Team Size\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_team',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Employers searching filters 'Team Size' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Team Size Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'employer_filters_team_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Map\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_map',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Employers top map switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Height\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_map_height',\n 'value' => '450',\n 'description' => esc_html__(\"Employers top map height.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Zoom\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_map_zoom',\n 'value' => '8',\n 'description' => esc_html__(\"Employers top map zoom.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Bar\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Employer's top search bar switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Style\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search_view',\n 'value' => array(\n esc_html__(\"Simple\", \"careerfy-frame\") => 'simple',\n esc_html__(\"Advance Search\", \"careerfy-frame\") => 'advance',\n ),\n 'description' => esc_html__(\"Employers top search style.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Radius\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search_radius',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable top search radius.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"AutoFill Search Box\", \"careerfy-frame\"),\n 'param_name' => 'top_search_autofill',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable autofill in search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Title, Keywords, or Phrase\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search_title',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Location\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search_location',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable location field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n if ($sectors_enable_switch == 'on') {\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'emp_top_search_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable Sector Dropdown field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n }\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sort by Fields\", \"careerfy-frame\"),\n 'param_name' => 'employer_sort_by',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Results search sorting section switch.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Excerpt Length\", \"careerfy-frame\"),\n 'param_name' => 'employer_excerpt',\n 'value' => '20',\n 'description' => esc_html__(\"Set the number of words you want to show for excerpt.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'employer_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Choose job list items order.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'employer_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n esc_html__(\"Promote Profile\", \"careerfy-frame\") => 'promote_profile',\n ),\n 'description' => esc_html__(\"Choose list items orderby.\", \"careerfy-frame\")\n );\n $emp_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Pagination\", \"careerfy-frame\"),\n 'param_name' => 'employer_pagination',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Choose yes if you want to show pagination for employer items.\", \"careerfy-frame\")\n );\n\n $emp_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Items per Page\", \"careerfy-frame\"),\n 'param_name' => 'employer_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how much employers you want to show per page. Leave it blank for all employers on a single page.\", \"careerfy-frame\")\n );\n $attributes = array(\n \"name\" => esc_html__(\"Employer Listing\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_employer_shortcode\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => apply_filters('jobsearch_employer_listings_vcsh_params', $emp_listsh_parms)\n );\n\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}",
"public function sector()\n\t{\n\t\t$json = new Json('config/access/sector.json');\n\t\t$sector = $json->gets();\n\t\t\n\t\t$array = array();\n\t\tif(count($sector) >= 1){\n\t\tforeach($sector as $key=>$val)\n\t\t{\n\t\t\t$array[$key] = text($val['name']);\n\t\t}\n\t\t}else{\n\t\t\t$array[''] = text(':not_sector');\n\t\t}\n\t\treturn $array;\n\t}",
"function careerfy_vc_candidate_listing()\n{\n global $jobsearch_plugin_options;\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n\n $sectors_enable_switch = isset($jobsearch_plugin_options['sectors_onoff_switch']) ? $jobsearch_plugin_options['sectors_onoff_switch'] : 500;\n\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n\n $jobsearch_job_cus_fields = get_option(\"jobsearch_custom_field_candidate\");\n $job_cus_field_arr = array();\n if (isset($jobsearch_job_cus_fields) && !empty($jobsearch_job_cus_fields) && sizeof($jobsearch_job_cus_fields) > 0) {\n foreach ($jobsearch_job_cus_fields as $key => $value) {\n $job_cus_field_arr[$value['label']] = $key;\n }\n }\n $cand_listsh_parms = [];\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"View\", \"careerfy-frame\"),\n 'param_name' => 'candidate_view',\n 'value' => array(\n esc_html__(\"Style 1\", \"careerfy-frame\") => 'view-default',\n esc_html__(\"Style 2\", \"careerfy-frame\") => 'view-grid',\n esc_html__(\"Style 3\", \"careerfy-frame\") => 'view-classic',\n esc_html__(\"Style 4\", \"careerfy-frame\") => 'view-modern',\n esc_html__(\"Style 5\", \"careerfy-frame\") => 'view-fancy',\n esc_html__(\"Style 6\", \"careerfy-frame\") => 'view-fancy-2',\n esc_html__(\"Style 7\", \"careerfy-frame\") => 'view-fancy-3',\n esc_html__(\"Style 8\", \"careerfy-frame\") => 'view-fancy-4',\n ),\n 'description' => esc_html__(\"Select candidates listing view.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'candidate_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Candidate Founds with display counts\", \"careerfy-frame\"),\n 'param_name' => 'display_per_page',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Display the per page candidates count at top of the listing.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'colorpicker',\n 'heading' => esc_html__(\"First Button Color\", \"careerfy-frame\"),\n 'param_name' => 'first_btn_color',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'candidate_view',\n 'value' => array('view-fancy-3')\n ),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Locations in listing\", \"careerfy-frame\"),\n 'param_name' => 'candidate_loc_listing',\n 'value' => array(\n esc_html__(\"Country\", \"careerfy-frame\") => 'country',\n esc_html__(\"State\", \"careerfy-frame\") => 'state',\n esc_html__(\"City\", \"careerfy-frame\") => 'city',\n ),\n 'std' => 'country,city',\n 'description' => esc_html__(\"Select which type of location in listing. If nothing select then full address will display.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'colorpicker',\n 'heading' => esc_html__(\"Second Button Color\", \"careerfy-frame\"),\n 'param_name' => 'second_btn_color',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'candidate_view',\n 'value' => array('view-fancy-3')\n ),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Candidates searching filters switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Count\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_count',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Sort by\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_sortby',\n 'value' => array(\n esc_html__(\"Default\", \"careerfy-frame\") => 'default',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'asc',\n esc_html__(\"Descending\", \"careerfy-frame\") => 'desc',\n esc_html__(\"Alphabetical\", \"careerfy-frame\") => 'alpha',\n esc_html__(\"Highest Count\", \"careerfy-frame\") => 'count',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_date',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Candidates searching filters 'Date Posted' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted Collapse\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_date_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Candidates searching filters 'Sector' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'candidate_filters_sector_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Map\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_map',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Candidates top map switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Height\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_map_height',\n 'value' => '450',\n 'description' => esc_html__(\"Candidates top map height.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Zoom\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_map_zoom',\n 'value' => '8',\n 'description' => esc_html__(\"Candidates top map zoom.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Bar\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Candidates top search bar switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Style\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search_view',\n 'value' => array(\n esc_html__(\"Simple\", \"careerfy-frame\") => 'simple',\n esc_html__(\"Advance Search\", \"careerfy-frame\") => 'advance',\n ),\n 'description' => esc_html__(\"Candidates top search style.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Radius\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search_radius',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Candidates top search radius.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Title, Keywords, or Phrase\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search_title',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Location\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search_location',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable location field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n if ($sectors_enable_switch == 'on') {\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'cand_top_search_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable Sector Dropdown field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n }\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"AutoFill Search Box\", \"careerfy-frame\"),\n 'param_name' => 'top_search_autofill',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable autofill in search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sort by Fields\", \"careerfy-frame\"),\n 'param_name' => 'candidate_sort_by',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Results search sorting section switch.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Excerpt Length\", \"careerfy-frame\"),\n 'param_name' => 'candidate_excerpt',\n 'value' => '20',\n 'description' => esc_html__(\"Set the number of words you want to show for excerpt.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'candidate_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Choose candidate list items order.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'candidate_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n esc_html__(\"Promote Profile\", \"careerfy-frame\") => 'promote_profile',\n ),\n 'description' => esc_html__(\"Choose list items orderby.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Pagination\", \"careerfy-frame\"),\n 'param_name' => 'candidate_pagination',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Choose yes if you want to show pagination for candidate items.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Items per Page\", \"careerfy-frame\"),\n 'param_name' => 'candidate_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how much candidates you want to show per page. Leave it blank for all candidates on a single page.\", \"careerfy-frame\")\n );\n $cand_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n 'param_name' => 'candidate_custom_fields_switch',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Enable / Disable job custom fields\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n );\n $cand_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Select Fields\", \"careerfy-frame\"),\n 'param_name' => 'candidate_elem_custom_fields',\n 'value' => $job_cus_field_arr,\n 'description' => '',\n 'group' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n );\n $attributes = array(\n \"name\" => esc_html__(\"Candidate Listing\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_candidate_shortcode\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => apply_filters('jobsearch_candidate_listings_vcsh_params', $cand_listsh_parms)\n );\n\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}",
"public function sectorsAction()\n {\n\n $id = $this->_getParam('industry_id');\n $sectorTable = Engine_Api::_ ()->getDbTable ( 'sectors', 'company' );\n $sectorSelect = $sectorTable->select ()->where ( 'industry_id = ?', $id);\n $sector = $sectorTable->fetchAll ( $sectorSelect );\n $this->view->industry_id = $id;\n $this->view->sectors = $sector;\n }",
"public function getSector(Request $request){\n \t$search_term = $request->input('term');\n \t$territory = $request->input('value_term');\n \t$sectors = Sector::where('sector', \"LIKE\", \"%{$search_term}%\")\n \t->where('territory_id', '=', $territory)\n \t->get(['id', 'sector as text']);\n\n \treturn response()->json($sectors);\n }",
"public function filterPropertyAction(Request $request)\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usr = $this->get('security.context')->getToken()->getUser();\n\t\t\n\t\t$postdata = $request->query->all();\n if (!isset($postdata['campaign'])) $postdata['campaign'] = false;\n\t\t\n\t\tif($postdata['campaign'] == true) {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterSectorsBySectorlistClientId($usr->getId());\n\t\t} else {\n\t\t\t$property_data = $em->getRepository('RefiBundle:Transactions')->filterSectors();\n\t\t}\n\t\t\n\t\t$sector_data = array();\n\t\tforeach($property_data as $property_data) {\n\t\t\t$sector_data[$property_data['sector']]['name'] = $property_data['name'];\n\t\t\t$sector_data[$property_data['sector']]['sector_code'] = $property_data['sector'];\n\t\t\t$sector_data[$property_data['sector']]['longitude'] = $property_data['longitude'];\n\t\t\t$sector_data[$property_data['sector']]['latitude'] = $property_data['latitude'];\n\t\t\t$sector_data[$property_data['sector']]['total_sector_prospects'] = $property_data['num_prospects']; \n\t\t}\n\t\t\n\t\t$response = new Response(json_encode($sector_data));\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n\t}",
"public function filtro(){\n \n $result = array();\n\n $filter = $_GET['filter'];\n $codigo = $_GET['codigo'];\n\n if(!empty($filter)){\n\n $result = $this->productos->get_term_combo($filter,$codigo, $this->session->userdata('user_id'));\n\n if(!empty($result)){\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>1,'data'=>$result) )\n );\n }else{\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>0) )\n );\n }\n \n\n }\n\n }",
"public function listingAjax(Request $request)\n {\n $parts = parse_url($request->extra);\n parse_str($parts['path'], $request1);\n\n $recordsTotal = StudentCertificate::where(\"manual\",$request1['manual'])->count();\n\n $studentsCertificates = StudentCertificate::search($request)\n ->where(\"manual\",$request1['manual']);\n $recordsFiltered = $studentsCertificates->count();\n\n $studentsCertificates = $studentsCertificates->skip($request->start)\n ->take($request->length)->get();\n\n $data =array();\n foreach($studentsCertificates as $key=>$item){\n $course_name = $item->course_name;\n if(!is_null($item->course))\n $course_name = $item->course->course_trans('ar')->name;\n $exam_name = $item->exam_name;\n if(!is_null($item->exam))\n $exam_name = $item->exam->quiz_trans('ar')->name;\n $student_name = '';\n if(!is_null($item->student))\n $student_name = $item->student->user->full_name_ar;\n\n $image = '<a href=\"'. asset('uploads/kcfinder/upload/image/'.$item->image) .'\" target=\"_blank\">\n <img src=\"'.asset('uploads/kcfinder/upload/image/'.$item->image).'\" alt=\"no image\" width=\"70px\"/></a>';\n if($request1['manual']){\n $row = array(\n '<input type=\"checkbox\" class=\"checkbox\" data-id=\"'.$item->id.'\">',\n $image,\n $student_name,\n $course_name,\n $item->serialnumber,\n $item->getStatus($item->active,$item->id) ,\n $item->date\n );\n }else{\n $row = array(\n '<input type=\"checkbox\" class=\"checkbox\" data-id=\"'.$item->id.'\">',\n $image,\n $student_name,\n $course_name,\n $exam_name,\n $item->serialnumber,\n $item->date\n );\n }\n array_push($data,$row);\n }\n $result = array(\"recordsTotal\"=>$recordsTotal,\"recordsFiltered\"=>$recordsFiltered,\"data\"=>array_values($data));\n return json_encode($result);\n }",
"public function ajax_lists_for_checkout()\n {\n if (isset($_POST['data'])) {\n $data = $_POST['data'];\n }\n else {\n $data = array();\n }\n\n // Get lists\n $lists = $this->get_lists();\n\n // Check if we have something pre-selected\n if (!empty($data)) {\n\n // Get merge vars\n $merge = $this->get_merge_vars($lists);\n\n // Get sets from correct option\n $sets = (isset($data['sets_type']) && isset($this->opt[$data['sets_type']])) ? $this->opt[$data['sets_type']] : $this->opt['sets'];\n\n // Get groups\n $groups = $this->get_groups($sets);\n\n }\n else {\n\n $merge = array();\n $groups = array();\n\n foreach ($lists as $list_key => $list_value) {\n\n if ($list_key == '') {\n continue;\n }\n\n // Blank merge vars\n $merge[$list_key] = array('' => '');\n\n // Blank groups\n $groups[$list_key] = array('' => '');\n }\n }\n\n // Add all checkout properties\n $checkout_properties = $this->checkout_properties;\n\n echo json_encode(array('message' => array('lists' => $lists, 'groups' => $groups, 'merge' => $merge, 'checkout_properties' => $checkout_properties)));\n die();\n }",
"public function index()\r\n {\r\n $checkin = '';\r\n $checkout = '';\r\n $stack = array();\r\n $room_types = array();\r\n $property_type_id = array();\r\n $checkin = $this->input->get('checkin');\r\n $checkout = $this->input->get('checkout');\r\n $nof_guest = $this->input->get('guests');\r\n $room_types = $this->input->get('room_types');\r\n $search_view = $this->input->get('search_view');\r\n\r\n $min = $this->input->get('price_min');\r\n $max = $this->input->get('price_max');\r\n\r\n $keywords = $this->input->get('keywords');\r\n\r\n $search_by_map = $this->input->get('search_by_map');\r\n $sw_lat = $this->input->get('sw_lat');\r\n $sw_lng = $this->input->get('sw_lng');\r\n $ne_lat = $this->input->get('ne_lat');\r\n $ne_lng = $this->input->get('ne_lng');\r\n\r\n $min_bedrooms = $this->input->get('min_bedrooms');\r\n $min_bathrooms = $this->input->get('min_bathrooms');\r\n $min_beds = $this->input->get('min_beds');\r\n\r\n $property_type_id = $this->input->get('property_type_id');\r\n $hosting_amenities = $this->input->get('hosting_amenities');\r\n\r\n\r\n $array_items = array(\r\n 'Vcheckin' => '',\r\n 'Vcheckout' => '',\r\n 'Vcheckout' => '',\r\n );\r\n $this->session->unset_userdata($array_items);\r\n\r\n if ($this->input->post('checkin') != '' || $this->input->post('checkin') != 'mm/dd/yy')\r\n {\r\n $freshdata = array(\r\n 'Vcheckin' => $this->input->get('checkin'),\r\n 'Vcheckout' => $this->input->get('checkout'),\r\n 'Vnumber_of_guests' => $this->input->get('number_of_guests'),\r\n );\r\n $this->session->set_userdata($freshdata);\r\n }\r\n\r\n if ($checkin != '--' && $checkout != '--' && $checkin != \"yy-mm-dd\" && $checkout != \"yy-mm-dd\")\r\n {\r\n $ans = $this->db->query(\"SELECT id,list_id FROM `calendar` WHERE `booked_days` = '\" . $checkin . \"' OR `booked_days` = '\" . $checkout . \"' GROUP BY `list_id`\");\r\n //echo $this->db->last_query();exit;\r\n $a = $ans->result();\r\n $this->db->flush_cache();\r\n // Now after the checkin is completed\r\n if (!empty($a))\r\n {\r\n foreach ($a as $a1)\r\n {\r\n array_push($stack, $a1->list_id);\r\n }\r\n }\r\n }\r\n\r\n $query = $this->input->get('location');\r\n $pieces = explode(\",\", $query);\r\n\r\n $print = \"\";\r\n $len = count($pieces);\r\n\r\n if ($search_by_map)\r\n {\r\n $this->db->where(\"lat BETWEEN $sw_lat AND $ne_lat\");\r\n $this->db->where(\"long BETWEEN $sw_lng AND $ne_lng\");\r\n }\r\n else\r\n {\r\n if ($query != '')\r\n {\r\n foreach ($pieces as $test)\r\n {\r\n $this->db->flush_cache();\r\n $test = $this->db->escape_like_str($test);\r\n $this->db->like('address', $test);\r\n }\r\n }\r\n }\r\n\r\n if (!empty($min_bedrooms))\r\n {\r\n $this->db->where('bedrooms', $min_bedrooms);\r\n }\r\n\r\n if (!empty($min_bathrooms))\r\n {\r\n $this->db->where('bathrooms', $min_bathrooms);\r\n }\r\n\r\n if (!empty($min_beds))\r\n {\r\n $this->db->where('beds', $min_beds);\r\n }\r\n\r\n if (!empty($stack))\r\n {\r\n $this->db->where_not_in('id', $stack);\r\n }\r\n\r\n if ($nof_guest > 1)\r\n {\r\n $this->db->where('capacity', $nof_guest);\r\n }\r\n\r\n if (is_array($room_types))\r\n {\r\n if (count($room_types) > 0)\r\n {\r\n foreach ($room_types as $room_type)\r\n {\r\n $this->db->where('room_type', $room_type);\r\n }\r\n }\r\n }\r\n\r\n\r\n if (is_array($hosting_amenities))\r\n {\r\n if (count($hosting_amenities) > 0)\r\n {\r\n foreach ($hosting_amenities as $amenity)\r\n {\r\n $this->db->like('amenities', $amenity);\r\n }\r\n }\r\n }\r\n\r\n\r\n if (isset($min))\r\n {\r\n if ($min > 0)\r\n {\r\n $this->db->where('price >=', $min);\r\n }\r\n }\r\n else\r\n {\r\n if (isset($max))\r\n {\r\n $min = 0;\r\n }\r\n }\r\n\r\n if (isset($max))\r\n {\r\n if ($max > $min)\r\n {\r\n $this->db->where('price <=', $max);\r\n }\r\n }\r\n\r\n\r\n if (is_array($property_type_id))\r\n {\r\n if (count($property_type_id) > 0)\r\n {\r\n $i = 1;\r\n foreach ($property_type_id as $r)\r\n {\r\n if ($i == 1)\r\n $this->db->where('property_id', $r);\r\n else\r\n $this->db->or_where('property_id', $r);\r\n\r\n $i++;\r\n }\r\n }\r\n }\r\n\r\n if (!empty($keywords))\r\n {\r\n $keywords = $this->db->escape_like_str($keywords);\r\n\r\n $this->db->like('address', $keywords);\r\n $this->db->or_like('title', $keywords);\r\n $this->db->or_like('desc', $keywords);\r\n }\r\n\r\n //Exececute the query\r\n $this->db->where('status !=', 0);\r\n $this->db->where('user_id !=', 0);\r\n $this->db->where('address !=', '0');\r\n $data['query'] = $this->db->get('list');\r\n $tCount = $data['query']->num_rows();\r\n //echo $this->db->last_query();exit;\r\n\r\n $properties = '';\r\n $sno = 1;\r\n if ($data['query']->num_rows() > 0)\r\n {\r\n foreach ($data['query']->result() as $row)\r\n {\r\n $images = $this->Gallery->get_images($row->id);\r\n if (count($images) == 0)\r\n $url = base_url() . 'images/no_image.jpg';\r\n else\r\n $url = $images[0]['url'];\r\n\r\n $profile_pic = $this->Gallery->profilepic($row->user_id, 3);\r\n\r\n if ($tCount == $sno)\r\n $comma = '';\r\n else\r\n $comma = ',';\r\n\r\n $properties .= '{\r\n\t\t\t\t\t \"available\":true,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"user_thumbnail_url\":\"' . $profile_pic . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"user_is_superhost\":false,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"lat\":' . $row->lat . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"has_video\":false,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"recommendation_count\":0,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"lng\":' . $row->long . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"user_id\":' . $row->user_id . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"user_name\":\"' . get_user_by_id($row->user_id)->username . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"review_count\":' . $row->review . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"address\":\"' . $row->address . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"city\":\"' . $row->city . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"state\":\"' . $row->state . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"country\":\"' . $row->country . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\":\"' . $row->title . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hosting_thumbnail_url\":\"' . $url . '\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id\":' . $row->id . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"price\":' . $row->price . ',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"currency\":\"' . $row->currency . '\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}' . $comma;\r\n\r\n\r\n $sno++;\r\n }\r\n }\r\n else\r\n {\r\n $properties = '{\"available\":false,\"reason_message\":\"Your search was a little too specific, searching for a different city.\"}';\r\n }\r\n\r\n\r\n $ajax_result = '[';\r\n\r\n $ajax_result .= $properties;\r\n\r\n $ajax_result .=']';\r\n\r\n echo $ajax_result;\r\n }",
"public function productos_libro_precios_filter(){\n\n $result = array();\n\n $filter = $_GET['filter'];\n\n if(!empty($filter)){\n\n $this->productos->initialize($this->dbConnection);\n\n $result = $this->productos->get_term_two($filter, $this->session->userdata('user_id'));\n\n if(!empty($result)){\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>1,'data'=>$result) )\n );\n }else{\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>0) )\n );\n }\n \n\n }\n\n }",
"function careerfy_vc_simple_jobs_listing_multi()\n{\n global $jobsearch_gdapi_allocation;\n\n $jobsearch__options = get_option('jobsearch_plugin_options');\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n $all_locations_type = isset($jobsearch__options['all_locations_type']) ? $jobsearch__options['all_locations_type'] : '';\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n\n $job_listsh_parms = array();\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'job_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'job_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Order dropdown will work for featured jobs only\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'job_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n ),\n 'description' => esc_html__(\"Choose job list items orderby.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Number of Jobs\", \"careerfy-frame\"),\n 'param_name' => 'job_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how many jobs you want to show.\", \"careerfy-frame\")\n );\n\n //\n $attributes = array(\n \"name\" => esc_html__(\"Simple Jobs Listing Multi\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_simple_jobs_listing_multi\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => $job_listsh_parms,\n );\n\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}",
"public function showAvailableCargoCategory ()\n\t{\n\t\t$departureidbranch = $this->input->post('keberangkatan');\n\t $arrivalidbranch = $this->input->post('kedatangan');\n\t $departuretime = $this->input->post('deliverytime');\n\n\t\t$data['cargocategory'] = $this->ModelSystem->showAvailableCargoCategory ($departureidbranch,\n\t\t\t$arrivalidbranch,\n\t\t\t$departuretime);\n\t\techo json_encode($data);\n\t}",
"function country_states(){\n if( isset($_POST['fields'])) {\n parse_str($_POST['fields'], $fields);\n // $api_url_country_states = 'http://api.gradpak.com/api/state_list_by_country_name';\n $data6 = array(\"country_name\"=> $fields['country'],'submit' => 'submit' );\n $postdata6 = json_encode($data6);\n // $api_token_country_states = \"22NYL9fy1OIsdAIEGD8f3XkMpudGFCS9hHFG7AWp\";\n $ch6 = curl_init(api_url_country_states);\n $authorization6 = \"Authorization: Bearer \".api_token_country_states; \n curl_setopt($ch6, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch6, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch6, CURLOPT_POST, 1);\n curl_setopt($ch6, CURLOPT_POSTFIELDS, $postdata6);\n curl_setopt($ch6, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch6, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch6, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization6 ));\n $result6 = curl_exec($ch6);\n curl_close($ch6);\n echo wp_send_json($result6);\n // echo json_encode($result6);\n } \n wp_die();\n}",
"public function ExpenseVoucherAdvanceFilterData() {\n\t\t$this->data['status_list'] = $status_list = collect(Config::ExpenseVoucherAdvanceStatus())->prepend(['id' => '', 'name' => 'Select Status']);\n\t\t$this->data['employee_list'] = collect(Employee::getEmployeeListBasedCompany())->prepend(['id' => '', 'name' => 'Select Employee']);\n\t\t$this->data['outlet_list'] = collect(Outlet::getOutletList())->prepend(['id' => '', 'name' => 'Select Outlet']);\n\n\t\treturn response()->json($this->data);\n\t}",
"public function store(Request $request, Sector $sector)\n {\n //\n }",
"public function searchItems(){\n if (!$this->is_logged_in(false)) {\n show_error('', 403);\n }\n $kubun = '2';\n $params = $this->input->post('param');\n $kvtList = $this->dvt_model->getAllKVTByKVTID($params['order_date'],$params['dvt_no'],$params['kvt_no'] ,$params['times'], $kubun);\n if(sizeof($kvtList) > 0){\n echo json_encode(array('data' => $this->formatKVTArray($kvtList)[0]['detail']));\n }else{\n echo json_encode(array('data' => $kvtList));\n }\n }",
"function careerfy_vc_simple_jobs_listing()\n{\n global $jobsearch_gdapi_allocation;\n $jobsearch__options = get_option('jobsearch_plugin_options');\n\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n\n $all_locations_type = isset($jobsearch__options['all_locations_type']) ? $jobsearch__options['all_locations_type'] : '';\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n\n $job_listsh_parms = array();\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"View\", \"careerfy-frame\"),\n 'param_name' => 'job_list_style',\n 'value' => array(\n esc_html__(\"Style 1\", \"careerfy-frame\") => 'style1',\n esc_html__(\"Style 2\", \"careerfy-frame\") => 'style2',\n esc_html__(\"Style 3\", \"careerfy-frame\") => 'style3',\n esc_html__(\"Style 4\", \"careerfy-frame\") => 'style4',\n esc_html__(\"Style 5\", \"careerfy-frame\") => 'style5',\n esc_html__(\"Style 6\", \"careerfy-frame\") => 'style6',\n esc_html__(\"Style 7\", \"careerfy-frame\") => 'style7',\n esc_html__(\"Style 8\", \"careerfy-frame\") => 'style8',\n esc_html__(\"Style 9\", \"careerfy-frame\") => 'style9',\n ),\n );\n\n $job_listsh_parms[] = array(\n 'type' => 'careerfy_browse_img',\n 'heading' => esc_html__(\"Image\", \"careerfy-frame\"),\n 'param_name' => 'title_img',\n 'value' => '',\n 'description' => esc_html__(\"Image will show above title\", \"careerfy-frame\"),\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => 'style4'\n ),\n );\n\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Title\", \"careerfy-frame\"),\n 'param_name' => 'job_list_title',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => array('style1', 'style2', 'style3', 'style4')\n ),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Description\", \"careerfy-frame\"),\n 'param_name' => 'job_list_description',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => array('style2', 'style4')\n ),\n );\n $job_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Locations in listing\", \"careerfy-frame\"),\n 'param_name' => 'job_list_loc_listing',\n 'value' => array(\n esc_html__(\"Country\", \"careerfy-frame\") => 'country',\n esc_html__(\"State\", \"careerfy-frame\") => 'state',\n esc_html__(\"City\", \"careerfy-frame\") => 'city',\n ),\n 'std' => 'country,city',\n 'description' => esc_html__(\"Select which type of location in listing. If nothing select then full address will display.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'job_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Featured Only\", \"careerfy-frame\"),\n 'param_name' => 'featured_only',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"If you set Featured Only 'Yes' then only Featured jobs will show.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'job_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Choose job list items order.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'job_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n ),\n 'description' => esc_html__(\"Choose job list items orderby.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Number of Jobs\", \"careerfy-frame\"),\n 'param_name' => 'job_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how many jobs you want to show.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Load More Jobs\", \"careerfy-frame\"),\n 'param_name' => 'job_load_more',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Choose yes if you want to show more job items.\", \"careerfy-frame\"),\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => array('style1', 'style2', 'style7', 'style8', 'style4', 'style5', 'style6', 'style9')\n ),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Link text\", \"careerfy-frame\"),\n 'param_name' => 'job_link_text',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => array('style3')\n ),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Link text URL\", \"careerfy-frame\"),\n 'param_name' => 'job_link_text_url',\n 'value' => '',\n 'description' => '',\n 'dependency' => array(\n 'element' => 'job_list_style',\n 'value' => array('style3')\n ),\n );\n $attributes = array(\n \"name\" => esc_html__(\"Simple Jobs Listing\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_simple_jobs_listing\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => $job_listsh_parms,\n );\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}",
"function careerfy_vc_jobs_listing()\n{\n global $jobsearch_gdapi_allocation, $jobsearch_plugin_options;\n $jobsearch__options = get_option('jobsearch_plugin_options');\n $sectors_enable_switch = isset($jobsearch_plugin_options['sectors_onoff_switch']) ? $jobsearch_plugin_options['sectors_onoff_switch'] : 500;\n\n $categories = get_terms(array(\n 'taxonomy' => 'sector',\n 'hide_empty' => false,\n ));\n\n $all_locations_type = isset($jobsearch__options['all_locations_type']) ? $jobsearch__options['all_locations_type'] : '';\n\n $cate_array = array(esc_html__(\"Select Sector\", \"careerfy-frame\") => '');\n if (is_array($categories) && sizeof($categories) > 0) {\n foreach ($categories as $category) {\n $cate_array[$category->name] = $category->slug;\n }\n }\n\n $jobsearch_job_cus_fields = get_option(\"jobsearch_custom_field_job\");\n $job_cus_field_arr = array();\n if (isset($jobsearch_job_cus_fields) && !empty($jobsearch_job_cus_fields) && sizeof($jobsearch_job_cus_fields) > 0) {\n foreach ($jobsearch_job_cus_fields as $key => $value) {\n $job_cus_field_arr[$value['label']] = $key;\n }\n }\n\n $job_listsh_parms = array();\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"View\", \"careerfy-frame\"),\n 'param_name' => 'job_view',\n 'value' => array(\n esc_html__(\"Style 1\", \"careerfy-frame\") => 'view-default',\n esc_html__(\"Style 2\", \"careerfy-frame\") => 'view-medium',\n esc_html__(\"Style 3\", \"careerfy-frame\") => 'view-listing2',\n esc_html__(\"Style 4\", \"careerfy-frame\") => 'view-grid2',\n esc_html__(\"Style 5\", \"careerfy-frame\") => 'view-medium2',\n esc_html__(\"Style 6\", \"careerfy-frame\") => 'view-grid',\n esc_html__(\"Style 7\", \"careerfy-frame\") => 'view-medium3',\n esc_html__(\"Style 8\", \"careerfy-frame\") => 'view-grid3',\n esc_html__(\"Style 9\", \"careerfy-frame\") => 'view-grid-4',\n ),\n 'description' => esc_html__(\"Select jobs listing view.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'job_cat',\n 'value' => $cate_array,\n 'description' => esc_html__(\"Select Sector.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Founds with display counts\", \"careerfy-frame\"),\n 'param_name' => 'display_per_page',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Display the per page jobs count at top of the listing.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Featured Only\", \"careerfy-frame\"),\n 'param_name' => 'featured_only',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"If you set Featured Only 'Yes' then only Featured jobs will show.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Employer Base Jobs\", \"careerfy-frame\"),\n 'param_name' => 'jobs_emp_base',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Show only Selected Employer Jobs.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Employer Base Jobs\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Employer ID\", \"careerfy-frame\"),\n 'param_name' => 'jobs_emp_base_id',\n 'value' => '',\n 'description' => esc_html__(\"Put employer ID here.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Employer Base Jobs\", \"careerfy-frame\"),\n );\n if ($all_locations_type == 'api') {\n\n $api_contries_list = array();\n if (class_exists('JobSearch_plugin')) {\n $api_contries_list = $jobsearch_gdapi_allocation::get_countries();\n }\n if (!empty($api_contries_list)) {\n foreach ($api_contries_list as $api_cntry_key => $api_cntry_val) {\n if (isset($api_cntry_val->code)) {\n $contry_arr_list[$api_cntry_val->code] = $api_cntry_val->name;\n }\n }\n }\n\n// $contry_arr_list = array('' => esc_html__(\"Select Country\", \"careerfy-frame\"));\n// if (!empty($api_contries_list)) {\n// foreach ($api_contries_list as $api_cntry_key => $api_cntry_val) {\n// if (isset($api_cntry_val['code'])) {\n// $contry_arr_list[$api_cntry_val['code']] = $api_cntry_val['name'];\n// }\n// }\n// }\n\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Selected Location Jobs\", \"careerfy-frame\"),\n 'param_name' => 'selct_loc_jobs',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Show only Selected Location Jobs.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Location Based Jobs\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'jobsearch_gapi_locs',\n 'heading' => esc_html__(\"Select Location\", \"careerfy-frame\"),\n 'param_name' => 'selct_gapiloc_str',\n 'api_contry_list' => $contry_arr_list,\n 'value' => '',\n 'description' => '',\n 'group' => esc_html__(\"Location Based Jobs\", \"careerfy-frame\"),\n );\n }\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters\", \"careerfy-frame\"),\n 'param_name' => 'job_filters',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs searching filters switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Count\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_count',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Filters Sort by\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_sortby',\n 'value' => array(\n esc_html__(\"Default\", \"careerfy-frame\") => 'default',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'asc',\n esc_html__(\"Descending\", \"careerfy-frame\") => 'desc',\n esc_html__(\"Alphabetical\", \"careerfy-frame\") => 'alpha',\n esc_html__(\"Highest Count\", \"careerfy-frame\") => 'count',\n ),\n 'description' => esc_html__(\"Show result counts in front of every filter.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Keyword Search\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_keyword',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Jobs filters 'Keyword Search' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_loc',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs searching filters 'Location' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_loc_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Locations Filter Style\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_loc_view',\n 'value' => array(\n esc_html__(\"Checkbox List\", \"careerfy-frame\") => 'checkboxes',\n esc_html__(\"Dropdown Fields\", \"careerfy-frame\") => 'dropdowns',\n esc_html__(\"Input Field\", \"careerfy-frame\") => 'input',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_date',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs searching filters 'Date Posted' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Date Posted Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_date_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Type\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_type',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs searching filters 'Job Type' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Type Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_type_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs searching filters 'Sector' switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector Filter Collapse\", \"careerfy-frame\"),\n 'param_name' => 'job_filters_sector_collapse',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => '',\n 'group' => esc_html__(\"Filters Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Map\", \"careerfy-frame\"),\n 'param_name' => 'job_top_map',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Jobs top map switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Height\", \"careerfy-frame\"),\n 'param_name' => 'job_top_map_height',\n 'value' => '450',\n 'description' => esc_html__(\"Jobs top map height.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Map Zoom\", \"careerfy-frame\"),\n 'param_name' => 'job_top_map_zoom',\n 'value' => '8',\n 'description' => esc_html__(\"Jobs top map zoom.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Map Settings\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Featured Jobs on Top\", \"careerfy-frame\"),\n 'param_name' => 'job_feat_jobs_top',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Featured jobs will display on top of listing.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Featured Jobs\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Number of Featured jobs\", \"careerfy-frame\"),\n 'param_name' => 'num_of_feat_jobs',\n 'value' => '5',\n 'description' => '',\n 'group' => esc_html__(\"Featured Jobs\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Bar\", \"careerfy-frame\"),\n 'param_name' => 'job_top_search',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Jobs top search bar switch.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Style\", \"careerfy-frame\"),\n 'param_name' => 'job_top_search_view',\n 'value' => array(\n esc_html__(\"Simple\", \"careerfy-frame\") => 'simple',\n esc_html__(\"Advance Search\", \"careerfy-frame\") => 'advance',\n ),\n 'description' => esc_html__(\"Jobs top search style.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Top Search Radius\", \"careerfy-frame\"),\n 'param_name' => 'job_top_search_radius',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'default' => 'yes',\n 'description' => esc_html__(\"Enable/Disable top search radius.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Title, Keywords, or Phrase\", \"careerfy-frame\"),\n 'param_name' => 'top_search_title',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Location\", \"careerfy-frame\"),\n 'param_name' => 'top_search_location',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable location field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n if ($sectors_enable_switch == 'on') {\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sector\", \"careerfy-frame\"),\n 'param_name' => 'top_search_sector',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable Sector Dropdown field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n }\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"AutoFill Search Box\", \"careerfy-frame\"),\n 'param_name' => 'top_search_autofill',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Enable/Disable autofill in search keyword field.\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Top Search\", \"careerfy-frame\"),\n );\n\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Sort by Fields\", \"careerfy-frame\"),\n 'param_name' => 'job_sort_by',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Results search sorting section switch. When choosing option yes then jobs display counts will show.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Locations in listing\", \"careerfy-frame\"),\n 'param_name' => 'job_loc_listing',\n 'value' => array(\n esc_html__(\"Country\", \"careerfy-frame\") => 'country',\n esc_html__(\"State\", \"careerfy-frame\") => 'state',\n esc_html__(\"City\", \"careerfy-frame\") => 'city',\n ),\n 'std' => 'country,city',\n 'description' => esc_html__(\"Select which type of location in listing. If nothing select then full address will display.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"RSS Feed\", \"careerfy-frame\"),\n 'param_name' => 'job_rss_feed',\n 'dependency' => array(\n 'element' => 'job_sort_by',\n 'value' => 'yes',\n ),\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => ''\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Excerpt Length\", \"careerfy-frame\"),\n 'param_name' => 'job_excerpt',\n 'value' => '20',\n 'description' => esc_html__(\"Set the number of words you want to show for excerpt.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Order\", \"careerfy-frame\"),\n 'param_name' => 'job_order',\n 'value' => array(\n esc_html__(\"Descending\", \"careerfy-frame\") => 'DESC',\n esc_html__(\"Ascending\", \"careerfy-frame\") => 'ASC',\n ),\n 'description' => esc_html__(\"Choose job list items order.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Orderby\", \"careerfy-frame\"),\n 'param_name' => 'job_orderby',\n 'value' => array(\n esc_html__(\"Date\", \"careerfy-frame\") => 'date',\n esc_html__(\"Title\", \"careerfy-frame\") => 'title',\n ),\n 'description' => esc_html__(\"Choose job list items orderby.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Pagination\", \"careerfy-frame\"),\n 'param_name' => 'job_pagination',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => esc_html__(\"Choose yes if you want to show pagination for job items.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Jobs per Page\", \"careerfy-frame\"),\n 'param_name' => 'job_per_page',\n 'value' => '10',\n 'description' => esc_html__(\"Set number that how much jobs you want to show per page. Leave it blank for all jobs on a single page.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Quick Apply job\", \"careerfy-frame\"),\n 'param_name' => 'quick_apply_job',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'off',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'on',\n ),\n 'description' => esc_html__(\"By setting this option to yes, when user will click on job title or image, pop-up will be appear from the side.\", \"careerfy-frame\")\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n 'param_name' => 'job_custom_fields_switch',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'description' => esc_html__(\"Enable / Disable job custom fields\", \"careerfy-frame\"),\n 'group' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'checkbox',\n 'heading' => esc_html__(\"Select Fields\", \"careerfy-frame\"),\n 'param_name' => 'job_elem_custom_fields',\n 'value' => $job_cus_field_arr,\n 'description' => '',\n 'group' => esc_html__(\"Custom Fields\", \"careerfy-frame\"),\n );\n $job_listsh_parms[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Job Deadline\", \"careerfy-frame\"),\n 'param_name' => 'job_deadline_switch',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'Yes',\n ),\n 'description' => esc_html__(\"Enable / Disable jobs deadline date in listings\", \"careerfy-frame\"),\n );\n\n //\n $attributes = array(\n \"name\" => esc_html__(\"Jobs Listing\", \"careerfy-frame\"),\n \"base\" => \"jobsearch_job_shortcode\",\n \"class\" => \"\",\n \"category\" => esc_html__(\"Wp JobSearch\", \"careerfy-frame\"),\n \"params\" => apply_filters('jobsearch_job_listings_vcsh_params', $job_listsh_parms)\n );\n\n if (function_exists('vc_map') && class_exists('JobSearch_plugin')) {\n vc_map($attributes);\n }\n}",
"function getUnitsData($id = ''){\n //$val = $this->input->post('val');\n\n if ($id != '' || $id != null) {\n $val = $this->input->post('val');\n $url = ProductOffers.\"produnits/\". $val;\n $cursor = json_decode($this->callapi->CallAPI('GET',$url),true);\n \n echo json_encode(array('data' => $cursor));\n } else {\n $val = $this->input->post('val');\n // echo '****';\n // var_dump($val);\n $url = ProductOffers.\"produnits/\". $val;\n \n $cursor = json_decode($this->callapi->CallAPI('GET',$url),true);\n \n // echo \"hiiii\" ;\n \n \n \n if ($cursor) {\n $entitiesData = array();\n $entityData = [];\n foreach ($cursor as $dat) {\n\n foreach ($dat['units'] as $data) {\n $untiData = [];\n $untiData[\"id\"] = $data[\"unitId\"];\n $untiData[\"title\"] = $data[\"name\"][\"en\"];\n array_push($entitiesData, $untiData); \n }\n \n \n }\n\n echo json_encode(array('data' => $entitiesData));\n } else {\n $entities = array();\n $entities = '<option value=\"\">Select Products</option>';\n $entities .= '<option data-name=\"\" value=\"\">' . 'No product to select' . '</option>';\n echo $entities;\n }\n\n }\n \n\n\n }",
"public function index()\n {\n $items = EvaluationCriteria::all();\n\n $result = array();\n\n foreach ($items as $item) {\n $actionBtn = '<div class=\"btn-group\">\n <button type=\"button\" class=\"btn btn-sm btn-primary dropdown-toggle\" data-toggle=\"dropdown\">\n Actions <span class=\"caret\"></span>\n </button>\n <ul class=\"dropdown-menu\" role=\"menu\" id=\"actionDrop\">\n <li><a class=\"edit\" data-toggle=\"modal\"\n data-target=\"#editSectorModal\" data-id=\"'.$item->id.'\">Edit</a></li>\n <li><a class=\"delete\" data-id=\"'.$item->id.'\" href=\"javascript:void(0);\" >Delete</a></li>\n </ul>\n </div>';\n\n $createdDate = 'NA';\n\n if(isset($item->created_at)){\n $createdDate = date('d M, Y',strtotime($item->created_at) );\n } \n array_push($result, [\n $item->percentage,\n date('d M, Y',strtotime($item->start_date)),\n date('d M, Y',strtotime($item->end_date)),\n // $createdDate,\n $actionBtn\n ]);\n }\n return response()->json(['sectors'=>$result]);\n }",
"public function centralLevelPendingRequest(Request $request){\n try{\n $centralUser = $request->user();\n if(!$centralUser || !$centralUser->hasRole('central'))\n throw new Exception(\"Please try to login as central user!\");\n\n $pendingRequest = KitItemRequest::where([\n 'central_user_id'=>$centralUser->id,\n 'status'=> 4 //formation\n ])->whereIn('stage', array(1,2,3))->get();\n\n if(count($pendingRequest) == 0 ){\n return ['success'=>true,'data'=>[]];\n }\n\n foreach( $pendingRequest as $pRequest){\n $kitItems = \\GuzzleHttp\\json_decode($pRequest->kit_items);\n if(count($kitItems) > 0 ){\n foreach ($kitItems as $key=>$subKitItem){ // quarter mast\n $kitItems[$key]->quarter_master = TermRelation::getQuarterMasterInfoByUserId($subKitItem->quarter_master_user_id);\n foreach($subKitItem->kit_items as $q=>$unitLevel) { //units\n $kitItems[$key]->kit_items[$q]->unit = TermRelation::getUnitInfoByUserId($unitLevel->unit_user_id);\n if (is_array($unitLevel->kit_items)) {\n foreach ($unitLevel->kit_items as $k => $companyLevel) { // company\n $kitItems[$key]->kit_items[$q]->kit_items[$k]->company = TermRelation::getCompanyInfoByUserId($companyLevel->company_user_id);\n $kitItems[$key]->kit_items[$q]->kit_items[$k]->items = KitItem::getKitItemsByIds(explode(',',$companyLevel->kit_items->kit_ids));\n }\n }\n }\n }\n }\n $pRequest->kit_items = $kitItems;\n $pRequest->formation = TermRelation::getFormationInfoByUserId($pRequest->district_user_id);\n }\n\n return ['success'=>true,'data'=>$pendingRequest];\n }catch (Exception $e){\n return ['success'=>false, 'message'=>$e->getMessage()];\n }\n }",
"public function testCreateStock(){\n $this->json(\"POST\", 'api/stock',['product_name'=>\"GSM antenna\",'selling_price'=>200.45,'reorder_level'=>3,'barcode'=>'123457890'])\n ->seeJson(['successful'=>true]);\n\n }",
"public function objectcateReq (Request $request)\n {\n $subcatpack = (new Repository(new SubCategory))->getAll(); \n return response()->json($subcatpack);\n\n }",
"public function layerednavAction()\r\n {\r\n if (isset($_GET[\"s\"]) && !empty($this->getRequest()->getParam('s'))) {\r\n $data = Mage::getModel('emapi/filters')->klevuSearchFilters($this);\r\n header(\"Content-Type: application/json\");\r\n echo json_encode($data);\r\n exit;\r\n }\r\n\r\n $fpcModel = Mage::getModel('fpccache/fpc');\r\n $fpcModel->setControllerObject($this);\r\n $cacheData = $fpcModel->getData();\r\n if (!empty($cacheData)) {\r\n header(\"Content-Type: application/json\");\r\n echo $cacheData;\r\n die;\r\n }\r\n\r\n $attrs = Mage::getModel('emapi/filters')->oldFilters($this);\r\n $fpcModel->setData($attrs);\r\n header(\"Content-Type: application/json\");\r\n print_r(json_encode($attrs));\r\n die;\r\n }",
"public function getRoad(Request $request){\n \t$search_term = $request->input('term');\n \t$territory = $request->input('value_term');\n\n \t$sectors = Road::where('road', \"LIKE\", \"%{$search_term}%\")\n \t->where('sectors_id', '=', $territory)\n \t->get(['id', 'road as text']);\n\n \treturn response()->json($sectors);\n }",
"public function ajax_groups_and_tags_in_array_for_checkout()\n {\n // Check if we have received required data\n if (isset($_POST['data']) && isset($_POST['data']['list'])) {\n $groups = $this->get_groups($_POST['data']['list']);\n $merge_vars = $this->get_merge_vars(array($_POST['data']['list'] => ''));\n }\n else {\n $groups = array('' => '');\n $merge_vars = array('' => '');\n }\n\n $checkout_properties = $this->checkout_properties;\n\n echo json_encode(array('message' => array('groups' => $groups, 'merge' => $merge_vars, 'checkout_properties' => $checkout_properties)));\n die();\n }",
"public function list(Request $request)\n {\n if($request->ajax())\n {\n \n \n $data=json_decode($request['queryParams'], true);\n $filtros=$data['filters'];\n if(count($filtros)==0)\n {\n \n $data = Product::select('products.id','products.description','products.codigo','products.stock','products.img','products.price_venta','categories.name as categoria')\n ->join('categories', 'categories.id', '=', 'products.category_id')\n ->orderBy('categories.id', 'desc')\n ->where('products.description', 'like', '%' .$data['global_search']. '%')\n ->paginate($request['per_page']); \n \n return response()->json($data);\n }else{\n $name='';\n $dni='';\n \n\n foreach ($filtros as $value)\n {\n if($value['name']=='name')\n {\n $name=$value['text'];\n }\n if($value['name']=='dni')\n {\n $dni=$value['text'];\n }\n }\n \n $data=Client::name($name)->dni($dni)->paginate($request['per_page']);\n return response()->json($data);\n }\n \n }else{\n return view('home');\n }\n\n }",
"public function index()\n {\n return response()->json(Sector::paginate(), 200);\n }"
] | [
"0.55164635",
"0.53219724",
"0.53099245",
"0.52857435",
"0.5251935",
"0.52424145",
"0.5154418",
"0.5134136",
"0.49788013",
"0.49653253",
"0.4938054",
"0.49141997",
"0.48870173",
"0.4841016",
"0.48231584",
"0.48186913",
"0.48177734",
"0.48158848",
"0.4801054",
"0.4794948",
"0.47861162",
"0.47830293",
"0.47771233",
"0.47400236",
"0.4738748",
"0.47203323",
"0.47192186",
"0.47116938",
"0.46968785",
"0.46701488"
] | 0.69595504 | 0 |
// |route: /api/shortlist/blast |postdata: | prospects : json_encode of filter API | public function shortlistBlastAction(Request $request)
{
$session = new Session();
$postdata = $request->request->all();
$status = 'fail';
$message = 'Nothing to blast.';
if (!isset($postdata['prospects'])) $postdata['prospects'] = 0;
$prospect_ids = array();
$sector_codes = array();
if($postdata['prospects'] !== 0) {
$prospects = json_decode($postdata['prospects']);
foreach($prospects as $object) {
foreach($object as $sector) {
$sector_codes[] = $sector->sector_code;
foreach($sector->properties as $property) {
foreach($property->prospects as $prospect) {
$prospect_ids[] = $prospect->prospect_id;
}
}
}
}
$session->set('sector_codes', $sector_codes);
$session->set('prospect_ids', $prospect_ids);
$status = 'ok';
$message = 'Blasted!';
}
$msg = array('status' => $status, 'message' => $message);
$response = new Response(json_encode($msg));
if($status == 'fail') {
$response->setStatusCode(Response::HTTP_BAD_REQUEST);
} else {
$response->setStatusCode(Response::HTTP_OK);
}
$response->headers->set('Content-Type', 'application/json');
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whosonfirst_brands_get_brands($sz, $more=array()){\n\n\t\t$query = array(\n\t\t\t\"match_all\" => array()\n\t\t);\n\n\t\t# please reconcile me with whosonfirst_brands_search\n\t\t# and generally put somewhere modular and abstract...\n\t\t# (20171123/thisisaaronland)\n\n\t\t$filter = array();\n\n\t\tif ($sz){\n\n\t\t\t$must = array('terms' => array(\n\t\t\t\t'wof:brand_size' => $sz\n\t\t\t));\n\n\t\t\t$filter['and'] = array(\n\t\t\t\tarray('bool' => array('must' => $must))\n\t\t\t);\n\t\t}\n\n\t\t$sort = array(array(\n\t\t\t\"wof:brand_name\" => array(\"order\" => \"asc\")\n\t\t));\n\n\t\t$query = array(\"filtered\" => array(\n\t\t\t\"filter\" => $filter,\n\t\t\t\"query\" => $query,\n\t\t));\n\n\t\t$req = array(\n\t\t\t\"query\" => $query,\n\t\t\t\"sort\" => $sort,\n\t\t);\n\n\t\t$rsp = elasticsearch_brands_search($req, $more);\t\t\n\t\treturn $rsp;\n\t}",
"function bmAction(){\n\t\t $this->_helper->viewRenderer->setNoRender();\n\t\t \n\t\t if(isset($_REQUEST[\"q\"])){\n\t\t\t\t$rawMatch = $_REQUEST[\"q\"];\n\t\t }\n\t\t else{\n\t\t\t\t$rawMatch = \"spindle whorl\";\n\t\t }\n\t\t \n\t\t if(strstr($rawMatch, \"::\")){\n\t\t\t\t$matchEx = explode(\"::\", $rawMatch);\n\t\t\t\t$keyword = $matchEx[count($matchEx) - 1];\n\t\t }\n\t\t else{\n\t\t\t\t$keyword = $rawMatch;\n\t\t }\n\t\t \n\t\t Zend_Loader::loadClass('LinkedData_BritishMuseum');\n\t\t Zend_Loader::loadClass('LinkedData_ApproximateSearch');\n\t\t Zend_Loader::loadClass('Zend_Cache');\n\t\t Zend_Loader::loadClass('Zend_Json');\n\t\t \n\t\t $BMobj = new LinkedData_BritishMuseum;\n\t\t $BMobj->getItemIDsByKeyword($keyword);\n\t\t $BMobj->getTypologyThesaurusLD();\n\t\t \n\t\t $output = array(\"colExampleURI\" => $BMobj->colExampleURI,\n\t\t\t\t\t\t\t\t\"LDcolExampleURI\" => $BMobj->LDcolExampleURI,\n\t\t\t\t\t\t\t\t\"LDthesaurusURI\" => $BMobj->LDthesaurusURI,\n\t\t\t\t\t\t\t\t\"LDthesaurusLabel\" => $BMobj->LDthesaurusLabel,\n\t\t\t\t\t\t\t\t\"results\" => $BMobj->jsonObj,\n\t\t\t\t\t\t\t\t\"sparql\" => $BMobj->sparql\n\t\t\t\t\t\t\t\t);\n\t\t header('Content-Type: application/json; charset=utf8');\n\t\t echo Zend_Json::encode($output);\n\t\t \n\t }",
"public function getMoreRecordsBrand(Request $request){\n $where = $request->filtersform;\n\t\tparse_str($where, $res);\n\t $singlebrand = Boilerbrand::where('slug', $res['product'] )->get()->first();\n\t\t$brand = $singlebrand->id;\n\t\t$data['brand'] = $singlebrand;\t\t \t\t\t\n\t\t$brand = Boilerbrand::pluck('id')->toArray();\n\n\t\tif(!empty($res['q'])){\n\t\t \n\t\t $fuel_type =[];\n\t\t $type =[];\n\t\t \n\t\t $boilers = Boiler::with('brands');\n\t\t \n\t\t if( isset($res['q']['fuel_type']) ){\n\t\t $fuel_type = $res['q']['fuel_type']; \n\t\t $boilers->whereIn('fuel_type',$fuel_type);\n\t\t }\n\t\t if( isset($res['q']['type']) ){\n\t\t $type = $res['q']['type'];\n\t\t $boilers->whereIn('boilertype',$type );\n\t\t }\n\t\t \n\t\t if( isset($res['q']['kwoutput']) ){\n\t\t \n\t\t $search = [];\n\t\t foreach($res['q']['kwoutput'] as $kw){\n\t\t if($kw == '11-20'){\n\t\t array_push($search, 11,12,13,14,15,16 ,17,18,19,20);\n\t\t }\n\t\t if($kw =='21-30'){\n\t\t array_push($search, 21,22,23,24,25,26,27,28,29,30);\n\t\t }\n\t\t if($kw == '30+'){\n\t\t array_push($search, 11,12,13,14,15,16 ,17,18,19,20);\n\t\t // $kwoutputs = [1,2,3,4,5,6 ,7, 8,9,10,11,12,13,14,15,16 ,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38];\n\t\t }\t\t\t\t \n\t\t \n\t\t }\n\t\t \n\t\t // print_r($search); exit(' ooooo'); \n\t\t \n\t\t $kwoutput = $res['q']['kwoutput'];\n\t\t \n\t\t $boilers->whereRaw('FIND_IN_SET(?, kwoutput)',$search );\n\t\t // $boilers->whereIn('kwoutput',$search );\n\t\t \n\t\t // $boilers->whereIn('kwoutput',$kwoutput );\n\t\t }\n\t\t \n\t\t $boilers->where('boilerbrand',$brand);\n\t\t $boilers->where('id', '<',$request->lastBoiler);\n\t\t $boilers->orderBy('id', 'DESC');\n\t\t $boilers->limit(10);\n\t\t $boilers = $boilers->get(); \n\t\t \n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach($boilers as $boiler){\n\t\t\t\n\t\t\t$html .= '<div class=\"sthmb-box\"><div class=\"stbox-lft\"><img src=\"'.asset(\"images/finish/\".$boiler->filename).'\" width=\"143\" height=\"225\" alt=\"\" title=\"\"></div><div class=\"stbox-rgt\">';\n \t\t\t\t\t$html .='<img src=\"'. asset('images/boilerbrand/'.$boiler->brands->filename).'\" style = \"width:134px; height:59px;\" alt=\"\" title=\"\" />\n \t\t\t\t\t<h4>'.$boiler->name.'</h4>\n \t\t\t\t\t<div class=\"kwoptions\">\n \t\t\t\t\t\t<span>kW Options:</span>';\n \t\t\t\t\t\tif(isset($boiler->kwoutput)){\n \t\t\t\t\t\t\t $kwoutputs = explode(',', $boiler->kwoutput);\n \t\t\t\t\t\t\t$html .='<ul>';\n \t\t\t\t\t\t\t if(is_array($kwoutputs)){\n \t\t\t\t\t\t\t foreach($kwoutputs as $kwoutput){\n \t\t\t\t\t\t\t $html .='<li data-fancybox data-src=\"#kwpopup\">'. $kwoutput .'</li>';\n \t\t\t\t\t\t\t }\n \t\t\t\t\t\t\t \n \t\t\t\t\t\t }\n \t\t\t\t\t\t\t$html .='</ul>'; \n \t\t\t\t\t\t}\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t$html .='</div>\n \t\t\t\t\t<div class=\"botm-btns\">\n \t\t\t\t\t\t<a href=\"#\" onclick = \"compare('.$boiler->id.')\">+ Compare this Boiler</a>\n \t\t\t\t\t\t<a href=\"url(boiler/boiler-brands/'.$boiler->brands->slug.'/on/'.$boiler->slug .')\">View this Boiler</a>\n \t\t\t\t\t</div>\n \t\t\t\t</div>\n \t\t\t</div>';\n\t\t\t}\n\t\t\techo $html; die();\t\t\t \n\t\t \n\t\t}\n\t\t\n\t\telse{\n\t\t\t$boilers = Boiler::with('brands')->where('boilerbrand',$brand)->where('id', '<',$request->lastBoiler)->orderBy('id', 'DESC')->limit(10)->get();\n\t\t\t\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach($boilers as $boiler){\n\t\t\t\n\t\t\t$html .= '<div class=\"sthmb-box\"><div class=\"stbox-lft\"><img src=\"'.asset(\"images/finish/\".$boiler->filename).'\" width=\"143\" height=\"225\" alt=\"\" title=\"\"></div><div class=\"stbox-rgt\">';\n \t\t\t\t\t$html .='<img src=\"'. asset('images/boilerbrand/'.$boiler->brands->filename).'\" style = \"width:134px; height:59px;\" alt=\"\" title=\"\" />\n \t\t\t\t\t<h4>'.$boiler->name.'</h4>\n \t\t\t\t\t<div class=\"kwoptions\">\n \t\t\t\t\t\t<span>kW Options:</span>';\n \t\t\t\t\t\tif(isset($boiler->kwoutput)){\n \t\t\t\t\t\t\t $kwoutputs = explode(',', $boiler->kwoutput);\n \t\t\t\t\t\t\t$html .='<ul>';\n \t\t\t\t\t\t\t if(is_array($kwoutputs)){\n \t\t\t\t\t\t\t foreach($kwoutputs as $kwoutput){\n \t\t\t\t\t\t\t $html .='<li data-fancybox data-src=\"#kwpopup\">'. $kwoutput .'</li>';\n \t\t\t\t\t\t\t }\n \t\t\t\t\t\t\t \n \t\t\t\t\t\t }\n \t\t\t\t\t\t\t$html .='</ul>'; \n \t\t\t\t\t\t}\t\t\t\t\n \t\t\t\t\t\t\n \t\t\t\t\t$html .='</div>\n \t\t\t\t\t<div class=\"botm-btns\">\n \t\t\t\t\t\t<a href=\"#\" onclick = \"compare('.$boiler->id.')\">+ Compare this Boiler</a>\n \t\t\t\t\t\t<a href=\"url(boiler/boiler-brands/'.$boiler->brands->slug.'/on/'.$boiler->slug .')\">View this Boiler</a>\n \t\t\t\t\t</div>\n \t\t\t\t</div>\n \t\t\t</div>';\n\t\t\t}\n\t\t\techo $html; die();\t\t\n\t\t}\t\t\t\t\t\n\t\t\t\n\t\t$data['brand_filter'] = $res;\n\n}",
"function whosonfirst_brands_search($q, $sz, $more=array()){\n\n\t\t$esc_q = elasticsearch_escape($q);\n\n\t\t$query = array(\"match\" => array(\n\t\t\t\"_all\" => array(\n\t\t\t\t\"query\" => $esc_q,\n\t\t\t\t\"operator\" => \"and\",\n\t\t\t)\n\t\t));\n\n\t\t# please reconcile me with whosonfirst_brands_get_brands\n\t\t# and generally put somewhere modular and abstract...\n\t\t# (20171123/thisisaaronland)\n\n\t\t$filter = array();\n\n\t\tif ($sz){\n\n\t\t\t$must = array('terms' => array(\n\t\t\t\t'wof:brand_size' => $sz\n\t\t\t));\n\n\t\t\t$filter['and'] = array(\n\t\t\t\tarray('bool' => array('must' => $must))\n\t\t\t);\n\t\t}\n\n\t\t$sort = array(array(\n\t\t\t\"wof:brand_name\" => array(\"order\" => \"asc\")\n\t\t));\n\n\t\t$query = array(\"filtered\" => array(\n\t\t\t\"filter\" => $filter,\n\t\t\t\"query\" => $query,\n\t\t));\n\n\t\t$req = array(\n\t\t\t\"query\" => $query,\n\t\t\t\"sort\" => $sort,\n\t\t);\n\n\t\t$rsp = elasticsearch_brands_search($req, $more);\t\t\n\t\treturn $rsp;\n\t}",
"public function search_survey(){\n $res = $this->blueprint_model->search($this->input->get(\"query\"));\n header('Content-type: application/json');\n echo json_encode($res);\n }",
"public function actionBrandsList($q = null) {\n $query = new Query;\n \n $query->select('brand')\n ->distinct()\n ->from('tbl_product_lines')\n ->where('brand LIKE \"%' . $q .'%\"')\n ->orderBy('brand');\n $command = $query->createCommand();\n $data = $command->queryAll();\n $out = [];\n foreach ($data as $d) {\n $out[] = ['value' => $d['name']];\n }\n return $out;\n // echo Json::encode($out);\n }",
"function shortenByBitly($params) {\n\t\t//JavaScriptへ返す配列を準備\n\t\t$result = array();\n\n\t\t//可変長オブジェクトを引数に採っている\n\t\tforeach ($params as $key => $url) {\n\t\t\t//CakePHP用の処理\n\t\t\tif (!preg_match('/^p_\\d+$/', $key)) continue;\n\t\t\t\n\t\t\tif (!is_string($url)) die();\n\t\n\t\t\t$req = 'http://api.bit.ly/shorten?version=2.0.1';\n\t\t\t$req .= \"&login={$this->bitly_usr}\";\n\t\t\t$req .= \"&apiKey={$this->bitly_key}\";\n\t\t\t$req .= '&longUrl='.rawurlencode($url);\n\n\t\t\t$contents = file_get_contents($req);\n\t\t\tif(isset($contents)) {\n\t\t\t\t$bitly = json_decode($contents, true);\n\t\t\t}\n\t\t\t$result[] = $bitly['results'][$url]['shortUrl'];\n\t\t}\n\t\treturn json_encode($result);\n\t}",
"function search_patient_post(){\n\t\t$params = array(\n\t\t\t\"cog1\"\t=> $this->post('surname'),\n\t\t\t\"cog2\"\t=> $this->post('second_surname'),\n\t\t\t\"nom\"\t=> $this->post('first_name')\n\t\t);\t\t\n\t\t$patient_list = $this->Common_model->execute_sp(\n\t\t\tarray('sp_name'=>'mediagenda.malalts_sele_wgi',\n\t\t\t\t'params' => $params,\n\t\t\t\t'db_name' => 'default',\n\t\t\t\t'return_type' => 'array'\n\t\t\t)\n\t\t);\n\t\techo json_encode(array('patient_list'=>$patient_list,'success'=>true));\n\t}",
"public function getAllStaples()\n {\n $offset = @$this->input->post_get('offset');\n $limit = @$this->input->post_get('limit');\n $filter = array(\n 'factory_id' => @$this->input->post_get('company'), \n 'start' => @$this->input->post_get('start'), \n 'end' => @$this->input->post_get('end'), \n 'one_filter' => (@$this->input->post_get('one_filter') == 'true')?true:false, \n );\n $data = $this->posts->get_all_staples($offset, $limit, $filter);\n for ($i = 0; $i < count($data); $i++) {\n $data[$i]->before_deb = $this->posts->staple_deb($data[$i]->factory_id, $data[$i]->currency_id, date('Y-m-01'))->value;\n $data[$i]->current_deb = $this->posts->staple_deb($data[$i]->factory_id, $data[$i]->currency_id)->value;\n }\n $count = count($this->posts->get_all_staples(0, 100000000, $filter));\n $factories = $this->posts->get_all_data('factory');\n $currencies = $this->posts->get_all_data('currency');\n $this->output->set_content_type('application/json')->set_output(json_encode(array('success' => true, 'data' => $data, 'count' => $count, 'factories' => $factories, 'currencies' => $currencies)));\n }",
"public function getBwList()\r\n\t{\r\n\t\t// définition $bwList : cette liste doit être contenue dans un ARRAY (le code fonctionne sans cette ligne) :\r\n\t\t$bwList = [];\r\n\r\n\t\t// Avec \"*\", on sélectionne tout le contenu (les colonnes) de la table \"ta_bulkywaste\" :\r\n\t\t$q = $this->_db->query('SELECT * FROM ta_bulkywaste ORDER BY id');\r\n\t \r\n\t\t// Tant qu'il y a des lignes telles que \"$row\" dans la table \"ta_bulkywaste\", on les parcourt toutes (\"while\").\r\n\t\t// Pour chaque ligne/\"$row\" : on parcourt chaque valeur/colonne. Grâce à \"$q->fetch(PDO::FETCH_ASSOC)\", on intègre dans chaque \"$row\" toutes ces valeurs.\r\n\t\t// \"$row\" est donc un ARRAY (dont les clés sont les attributs de la class \"BulkyWaste\", et dont les valeurs sont celles prélevées dans le table)\r\n\t\twhile ($row = $q->fetch(PDO::FETCH_ASSOC))\r\n\t\t{\r\n\t\t\t// On rentre dans cette liste \"$bwList\" chaque objet BulkyWaste instancié : \"new BulkyWaste($row)\".\r\n\t\t\t// En effet, à chaque ligne/$row trouvée dans le table/DB, on instancie un BulkyWaste.\r\n\t\t\t// (Ex : s'il y a 48 encombrants dans la table, il y aura 48 lignes et donc 48 objets BulkyWaste instanciés)\r\n\t\t\t// Cet ARRAY \"$bwList\" contient donc une LISTE d'OBJETS BulkyWaste.\r\n\t\t\t// On rentre en argument de chaque objet BulkyWaste la ligne ($row) qui le définit.\r\n\t\t\t// (si on omet les \"[]\" de \"$bwList[]\", seul un objet/une ligne sera intégré dans la liste \"$bwList\")\r\n\t\t\t$bwList[] = new BulkyWaste($row);\r\n\t\t}\r\n\r\n\t\t// Pour pouvoir récupérer (get) et afficher cette liste, il faut la mettre en valeur de retour :\r\n\t\treturn $bwList;\r\n\t}",
"public function filtro(){\n \n $result = array();\n\n $filter = $_GET['filter'];\n $codigo = $_GET['codigo'];\n\n if(!empty($filter)){\n\n $result = $this->productos->get_term_combo($filter,$codigo, $this->session->userdata('user_id'));\n\n if(!empty($result)){\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>1,'data'=>$result) )\n );\n }else{\n $this->output->set_content_type('application/json')->set_output(\n json_encode(array('done'=>0) )\n );\n }\n \n\n }\n\n }",
"public function filters() {\n return response()->json($this->buildFilters());\n }",
"public function bysuburb() {\n \n \tif ($this->request->data) {\n \t\n \t// get the search terms from the post data\n \t$suburb = $this->request->data['suburb'];\n \t$state = $this->request->data['state'];\n \t\n \t// get a connection to the database\n \t$db = Connections::get('default');\n \t\n \t$results = array();\n \t\n \t$results = array_merge($results, $this->getFilmWeeklyBySuburb($suburb, $state, $db));\n \t\n \t// save an activity log entry\n \t$log = array(\n \t\t'type' => 'browse-by-suburb',\n \t\t'notes' => $this->request->data['suburb'] . ' - ' . $this->request->data['state'],\n \t\t'timestamp' => date('Y-m-d H:i:s')\n \t);\n \t\n \t$activity = ActivityLogs::create($log);\n \t$activity->save();\n \t\n \t\treturn compact('results');\n }\n \n }",
"public function getBrandsByBegin() {\r\n if ($input = $this->getInputSearch()) {\r\n\r\n $store = Mage::app()->getStore()->getId();\r\n $extended_search = Mage::getStoreConfig('shopbybrand/general/brand_extended_search', $store);\r\n $shopbybrands = Mage::getModel('shopbybrand/brand')->getCollection();\r\n $shopbybrands->setStoreId($this->getStoreId());\r\n $shopbybrands->addFieldToFilter('name', array('like' => '%' . $input . '%'));\r\n if ($extended_search) {\r\n $allIds1 = $shopbybrands->getAllIDs();\r\n $allIds2 = Mage::getModel('shopbybrand/brand')\r\n ->getCollection()\r\n ->setStoreId($this->getStoreId())\r\n ->addFieldToFilter('description', array('like' => '%' . $input . '%'))\r\n ->getAllIDs();\r\n $allIds = array_merge($allIds1, $allIds2);\r\n $allIds = array_unique($allIds);\r\n $shopbybrands = Mage::getModel('shopbybrand/brand')\r\n ->getCollection()\r\n ->setStoreId($this->getStoreId())\r\n ->addFieldToFilter('brand_id', array('in' => $allIds));\r\n }\r\n return $shopbybrands;\r\n }\r\n if ($top = $this->getRequest()->getParam(\"top\")) {\r\n if ($top == 'most_subscribers') {\r\n \r\n } elseif ($top == 'sales') {\r\n \r\n }\r\n }\r\n $begin = $this->getRequest()->getParam(\"begin\");\r\n $shopbybrands = Mage::helper(\"shopbybrand\")->getBrandsByBegin($begin);\r\n\r\n return $shopbybrands;\r\n }",
"function _prepareSearch(array $data)\n\t{\n\t\tif (!($this->getRequest()->isPost()))\n\t\t\t$this->forward('search', 'baby', null, null);\n\t\t\n\t\t$params = array();\n\t\t\n\t\t/** \n\t\t * Want to display these COMMON columns:\n\t\t * \t#, #, serial no, baby last, baby first, #, dob,\n\t\t * \tsex, mother last, mother first, language\n\t\t *\tStatus, Record Status, Record Owner\n\t\t **/\n\t\t\n\t\t// Get db adapter\n\t\t$db = Zend_Registry::get('db');\n\t\t\n\t\t// Build select query (using fluent interface)\n\t\t$select = $db->select()\n\t\t\n\t\t// Want distinct rows\n\t\t\t->distinct()\n\t\t\t\n\t\t// Group by baby's id\n\t\t\t->group('b.id')\n\t\t\n\t\t// Start from baby table + get baby information\n\t\t\t->from(array('b' => 'babies'),\n\t \tarray('baby_id' => 'id', 'last_name', 'first_name', 'dob', 'sex', \"record_status\" => 'checked_out'))\n\t\n\t\t// Get baby languages spoken + percent\n\t\t// Get through\n\t\t//\ta) concatanating language and percent per week into one field\n\t\t//\tb) group concatanation of multiple languages that one baby is exposed to\n\t\t//\tc) add group by id clause so each row is only one baby\n\t\t ->joinLeft(array('bl' => 'baby_languages'),\n\t\t 'b.id = bl.baby_id', array())\n\t\t\t->joinLeft(array('l' => 'languages'),\n\t\t\t\t'bl.language_id = l.id', array(\"language\" => new Zend_Db_Expr('GROUP_CONCAT(DISTINCT CONCAT_WS(\":\", l.language, bl.percent_per_week))')))\n\t\t\t\n\t\t// Get family information\n\t\t\t->joinLeft(array('f' => 'families'),\n\t\t\t\t'b.family_id = f.id', array('family_id' => 'id', 'mother_first_name', 'mother_last_name'))\n\t\t\t\n\t\t// Get status\n\t\t\t->joinLeft(array('sta' => 'statuses'),\n\t\t\t\t'b.status_id = sta.id', array('status'))\n\t\t\t\t\n\t\t// Get record owners (study : researcher)\n\t\t\t->joinLeft(array('bs' => 'baby_studies'),\n\t\t\t\t'b.id <=> bs.baby_id', array())\n\t\t\t->joinLeft(array('s' => 'studies'),\n\t\t\t\t'bs.study_id = s.id', array())\n\t\t\t->joinLeft(array('r' => 'researchers'),\n\t\t\t\t's.researcher_id = r.id', array(\"record_owner\" => new Zend_Db_Expr('CONCAT(r.researcher, \" : \", s.study)')))\n\t\t// Get lab\n\t\t\t->joinLeft(array('labs' => 'labs'),\n\t\t\t\t\"r.lab_id = labs.id\", array())\n\t\t// Get list id\n\t\t\t->joinLeft(array('lists' => 'lists'),\n\t\t\t\t\"b.list_id = lists.id\", array(\"list\"));\n\t\n\t\t/*\n\t\t\tBABY - POSSIBLE SEARCH PARAMATERS\n\t\t\t- id\n\t\t\t- Record Status\n\t\t\t- Status id\n\t\t\t- Date of entry (Range)\n\t\t\t- Last updated (Range)\n\t\t\t- first name\n\t\t\t- last name\n\t\t\t- sex\n\t\t\t- dob\n\t\t\t- bweight\n\t\t\t- term\n\t\t\t- ear infection\n\t\t\t- daycare\n\t\t\t- comments\n\t\t*/\n\t\t\t\t\n\t\tif (!(empty($data[\"baby\"]))) {\n\t\t\t$baby = $data[\"baby\"];\n\t\t\t\n\t\t\tif ($baby[\"id\"])\n\t\t\t\t$select->where(\"b.id = ?\", $baby[\"id\"]);\n\n if ($baby[\"list_id\"])\n $select->where(\"b.list_id = ?\", $baby[\"list_id\"]);\n\n\t\t\tif ($baby[\"record_status\"] === 0 || $baby[\"record_status\"] === 1)\n\t\t\t\t$select->where(\"b.checked_out = ?\", $baby[\"record_status\"]);\n\t\t\t\t\n\t\t\tif ($baby[\"status_id\"])\n\t\t\t\t$select->where(\"b.status_id = ?\", $baby[\"status_id\"]);\n\t\t\t\t\n\t\t\tif ($baby[\"created_from\"] and $baby[\"created_to\"]) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"b.date_of_entry\" .\n\t\t\t\t\t\" BETWEEN \" . $db->quote($baby[\"created_from\"]) . \n\t\t\t\t\t\" AND \" . $db->quote($baby[\"created_to\"])\n\t\t\t\t);\n\t\t\t} elseif ($baby[\"created_from\"]) {\n\t\t\t\t$select->where(\"b.date_of_entry = ?\", $baby[\"created_from\"]);\n\t\t\t}\n\t\t\t\n\t\t\tif ($baby[\"updated_from\"] and $baby[\"updated_to\"]) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"b.last_update\" .\n\t\t\t\t\t\" BETWEEN \" . new Zend_Db_Expr(\"CAST(\" . $db->quote($baby[\"updated_from\"]) . \" AS DATETIME)\") . \n\t\t\t\t\t\" AND \" . new Zend_Db_Expr(\"CAST(\" . $db->quote($baby[\"updated_to\"]) . \" AS DATETIME)\") .\n\t\t\t\t\t\" OR \" . $db->quoteInto(\"b.last_update LIKE ?\", \"{$baby[\"updated_to\"]}%\")\n\t\t\t\t);\n\t\t\t} elseif ($baby[\"updated_from\"]) {\n\t\t\t\t$select->where(\"b.last_update LIKE ?\", \"{$baby[\"updated_from\"]}%\");\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($baby[\"first_name\"])\n\t\t\t\t$select->where(\"b.first_name LIKE ?\", \"%{$baby['first_name']}%\");\n\t\t\t\n\t\t\tif ($baby[\"last_name\"])\n\t\t\t\t$select->where(\"b.last_name LIKE ?\", \"%{$baby['last_name']}%\");\n\t\t\t\t\n\t\t\tif ($baby[\"sex\"])\n\t\t\t\t$select->where(\"b.sex = ?\", $baby['sex']);\n\t\t\t\t\n\t\t\tif ($baby[\"dob_from\"] and $baby[\"dob_to\"]) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"b.dob\" .\n\t\t\t\t\t\" BETWEEN \" . $db->quote($baby[\"dob_from\"]) . \n\t\t\t\t\t\" AND \" . $db->quote($baby[\"dob_to\"])\n\t\t\t\t);\n\t\t\t} elseif ($baby[\"dob_from\"]) {\n\t\t\t\t$select->where(\"b.dob LIKE ?\", \"{$baby[\"dob_from\"]}%\");\n\t\t\t}\n\t\t\t\t\n\t\t\tif ($baby[\"birth_weight_pounds\"] or $baby[\"birth_weight_ounces\"]) {\n\t\t\t\t$pounds = ($baby[\"birth_weight_pounds\"]) ? $baby[\"birth_weight_pounds\"] : 0 ;\n\t\t\t\t$ounces = ($baby[\"birth_weight_ounces\"]) ? $baby[\"birth_weight_ounces\"]/16 : 0 ;\n\t\t\t\t$ounces = round($ounces, 2);\n\t\t\t\t$weight = $pounds + $ounces;\n\t\t\t\t$select->where(\"b.birth_weight LIKE ?\", \"{$weight}%\");\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif ($baby[\"term\"])\n\t\t\t\t$select->where(\"b.term = ?\", $baby[\"term\"]);\n\t\t\t\t\n\t\t\tif ($baby[\"ear_infection\"])\n\t\t\t\t$select->where(\"b.ear_infection = ?\", $baby[\"ear_infection\"]);\n\t\t\t\t\n\t\t\tif ($baby[\"daycare\"])\n\t\t\t\t$select->where(\"b.daycare = ?\", $baby[\"daycare\"]);\n\t\t\t\t\n\t\t\tif ($baby[\"comments\"])\n\t\t\t\t$select->where(\"b.comments LIKE ?\", \"%{$baby[\"comments\"]}%\");\n\t\t}\n\t\t\n\t\t/*\n\t\t\tLanguage (search for languages currently an AND query)\n\t\t*/\n\t\t\n\t\tforeach ($data[\"language\"] as $key => $languageSet) {\n\t\t\tif (empty($languageSet[\"language_id\"]))\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t$select->where(\"bl.language_id = ?\", $languageSet['language_id']);\n\t\t\t\n\t\t\t// Add percentage to query, if not empty\n\t\t\tif (!(empty($languageSet['rate']))) {\n\t\t\t\t// Want more or less than a certain percent\n\t\t\t\tswitch ($lang['moreorless']) {\n\t\t\t\t\tcase 'more':\n\t\t\t\t\t\t$select->where(\"bl.percent_per_week > ?\", $lang['rate']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'less':\n\t\t\t\t\t\t$select->where(\"bl.percent_per_week < ?\", $lang['rate']);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t# Do nothing\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t\tFamily - POSSIBLE SEARCH PARAMATERS\n\t\t\t- id\n\t\t\t- mother name + ethnicity\n\t\t\t- father name + ethnicity\n\t\t\t- address (city, state, zip)\n\t\t\t- how heard\n\t\t\t- income\n\t\t\t- comments\n\t\t*/\n\t\t\n\t\tif (!(empty($data[\"family\"]))) {\n\t\t\t$family = $data[\"family\"];\n\t\t\t\n\t\t\tif ($family[\"id\"])\n\t\t\t\t$select->where(\"f.id = ?\", $family[\"id\"]);\n\t\t\t\n\t\t\t/*Mother*/\n\t\t\t// First name\n\t\t\t($family['mother_first_name']) ? $select->where(\"f.mother_first_name LIKE ?\", \"%{$family['mother_first_name']}%\") : \"\" ;\n\t\t\t// Last name\n\t\t\t($family['mother_last_name']) ? $select->where(\"f.mother_last_name LIKE ?\", \"%{$family['mother_last_name']}%\") : \"\" ;\n\t\t\t// Ethnicity\n\t\t\t($family['mother_ethnicity_id']) ? $select->where(\"f.mother_ethnicity_id <=> ?\", $family['mother_ethnicity_id']) : \"\" ;\n\t\t\t\n\t\t\t/*Father*/\n\t\t\t// First name\n\t\t\t($family['father_first_name']) ? $select->where(\"f.father_first_name LIKE ?\", \"%{$family['father_first_name']}%\") : \"\" ;\n\t\t\t// Last name\n\t\t\t($family['father_last_name']) ? $select->where(\"f.father_last_name LIKE ?\", \"%{$family['father_last_name']}%\") : \"\" ;\n\t\t\t// Ethnicity\n\t\t\t($family['father_ethnicity_id']) ? $select->where(\"f.father_ethnicity_id <=> ?\", $family['father_ethnicity_id']) : \"\" ;\n\t\t\t\n\t\t\t/*Contact*/\n\t\t\tif ($family[\"city\"])\n\t\t\t\t$select->where(\"f.city LIKE ?\", \"%{$family['city']}%\");\n\t\t\tif ($family[\"state\"])\n\t\t\t\t$select->where(\"f.state LIKE ?\", \"%{$family['state']}%\");\n\t\t\tif ($family[\"zip\"])\n\t\t\t\t$select->where(\"f.zip = ?\", $family[\"zip\"]); \n\t\t\t\n\t\t\t// How Heard (search both how_heard and contact_source_id fields)\n\t\t\tif ($family[\"how_heard\"]) {\n\t\t\t\t$select->joinLeft(array(\"cs\" => \"contact_sources\"),\n\t\t\t\t\t\"f.contact_source_id = cs.id\", array());\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"cs.source LIKE ?\", \"%{$family[\"how_heard\"]}%\")\n\t\t\t\t\t. \" OR \" . \n\t\t\t\t\t$db->quoteInto(\"f.how_heard LIKE ?\", \"%{$family[\"how_heard\"]}%\")\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t// Income\n\t\t\tif ($family[\"income\"])\n\t\t\t\t$select->where(\"f.income LIKE ?\", $family[\"income\"]);\n\t\t\t\t\n\t\t\t// Comments\n\t\t\tif ($family[\"comments\"])\n\t\t\t\t$select->where(\"f.comments LIKE ?\", \"%{$family[\"comments\"]}%\");\n\t\t}\n\t\t\n\t\t/*\n\t\t\tContact - POSSIBLE SEARCH PARAMATERS\n\t\t\t- phone_number\n\t\t\t- email\n\t\t*/\n\t\t\n\t\tif (!(empty($data[\"contact\"]))) {\n\t\t\t$contact = $data[\"contact\"];\n\t\t\t\n\t\t\tif ($contact[\"phone_number\"]) {\n\t\t\t\t// 1. Join table\n\t\t\t\t$select->joinLeft(array('fp' => 'family_phones'),\n\t\t\t\t\t'f.id = fp.family_id', array('telephone' => new Zend_Db_Expr(\"GROUP_CONCAT(DISTINCT fp.phone_number SEPARATOR ', ')\")))\n\t\t\t\t\n\t\t\t\t// 2. Specify criteria\n\t\t\t\t\t->where(\"fp.phone_number LIKE ?\", \"%{$contact['phone_number']}%\");\n\t\t\t\t\t\n\t\t\t\t// Save param to display column\n\t\t\t\t$params[\"telephone\"] = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif ($contact[\"email\"]) {\n\t\t\t\t// 1. Join table\n\t\t\t\t$select->joinLeft(array('fe' => 'family_emails'),\n\t\t\t\t\t'f.id = fe.family_id', array())\n\t\t\t\t\n\t\t\t\t// 2. Specify criteria\n\t\t\t\t\t->where(\"fe.email LIKE ?\", \"%{$contact['email']}%\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t\tStudy - POSSIBLE SEARCH PARAMATERS\n\t\t\t- checkout (date)\n\t\t\t- study_id (name) -> nothing if ALL\n\t\t\t- caller_id\n\t\t\t- researcher_id (name) -> nothing if ALL\n\t\t\t- lab_id (name) -> nothing if ALL\n\t\t\t- date (study)\n\t\t\t- time (study)\n\t\t\t- level of enthusiasm\n\t\t\t- outcome_id\n\t\t*/\n\t\t\n\t\tif (!(empty($data[\"study\"]))) {\n\t\t\t$study = $data[\"study\"];\n\t\t\t$outcomeId = (empty($study[\"outcome_id\"])) ? 1 : $study[\"outcome_id\"];\n\n\t\t\t// Join study history\n\t\t\t$select\n\t\t\t\t->joinLeft(array('sh' => 'study_histories'),\n\t\t\t\t\t'b.id <=> sh.baby_id', array())\n\t\t\t\t->joinLeft(array('s_sh' => 'studies'),\n\t\t\t\t\t'sh.study_id <=> s_sh.id', array())\n\t\t\t\t->joinLeft(array('r_sh' => 'researchers'),\n\t\t\t\t\t's_sh.researcher_id <=> r_sh.id', array());\n\t\t\t\t\n\t\t\tif ($study[\"checkout\"]) {\n\t\t\t\t$select->where(\"b.checkout_date LIKE ?\", $study[\"checkout\"]);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"study_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"bs.study_id <=> ?\", $study[\"study_id\"])\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_id <=> ?\", $study[\"study_id\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"caller_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"bs.caller_id <=> ?\", $study[\"caller_id\"])\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.caller_id <=> ?\", $study[\"caller_id\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($study[\"researcher_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"r.id = ?\", $study[\"researcher_id\"])\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"r_sh.id = ?\", $study[\"researcher_id\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"lab_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"labs.id = ?\", $study[\"lab_id\"])\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"r_sh.lab_id = ?\", $study[\"lab_id\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"not_study_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"bs.study_id != ?\", $study[\"not_study_id\"])\n\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t\t$db->quoteInto(\"sh.study_id != ?\", $study[\"not_study_id\"])\n\t\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t\t. \")\"\n\t\t\t\t\t\t. \" IS NOT TRUE\"\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"not_caller_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t$db->quoteInto(\"bs.caller_id != ?\", $study[\"not_caller_id\"])\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.caller_id != ?\", $study[\"not_caller_id\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\t\n\t\t\tif (!empty($study[\"not_researcher_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"r.id != \", $study[\"not_researcher_id\"])\n\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t\t$db->quoteInto(\"r_sh.id != ?\", $study[\"not_researcher_id\"])\n\t\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t\t. \")\"\n\t\t\t\t\t\t. \" IS NOT TRUE\"\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($study[\"not_lab_id\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t$db->quoteInto(\"labs.id != ?\", $study[\"not_lab_id\"])\n\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\t\"(\" .\n\t\t\t\t\t\t\t$db->quoteInto(\"r_sh.lab_id != ?\", $study[\"not_lab_id\"])\n\t\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t\t. \")\"\n\t\t\t\t\t\t. \" IS NOT TRUE\"\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t$appointmentFrom = trim($study[\"date_from\"] . \" \" . $study[\"time_from\"]);\n\t\t\t$appointmentTo = trim($study[\"date_to\"] . \" \" . $study[\"time_to\"]);\n\t\t\t\n\t\t\tif (!empty($appointmentFrom) and !empty($appointmentTo)) {\n\t\t\t\t$select->where(\n\t\t\t\t\t// Range from current studies\n\t\t\t\t\t\"bs.appointment\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($appointmentFrom) . \" AS DATETIME)\")\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($appointmentTo) . \" AS DATETIME)\")\n\t\t\t\t\t. \" OR \" . $db->quoteInto(\"bs.appointment LIKE ?\", \"{$appointmentTo}%\")\n\t\t\t\t\t// Range from old studies (that were completed!)\n\t\t\t\t\t. \" OR (\"\n\t\t\t\t\t\t. \"(sh.appointment\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($appointmentFrom) . \" AS DATETIME)\")\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($appointmentTo) . \" AS DATETIME)\")\n\t\t\t\t\t\t. \")\"\n\t\t\t\t\t\t. \" AND \" . $db->quoteInto(\"sh.study_outcome_id = ?\", 1)\n\t\t\t\t\t. \")\"\n\t\t\t\t\t. \" OR (\" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.appointment LIKE ?\", \"{$appointmentTo}%\")\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t$db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t} elseif (!empty($appointmentFrom)) {\n\t\t\t\t$select->where(\n\t\t\t\t\t// Current studies\n\t\t\t\t\t$db->quoteInto(\"bs.appointment LIKE ?\", \"{$appointmentFrom}%\")\n\t\t\t\t\t// Or\n\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t// Old studies (that were completed)\n\t\t\t\t\t\"(\"\n\t\t\t\t\t\t. $db->quoteInto(\"sh.appointment LIKE ?\", \"{$appointmentFrom}%\")\n\t\t\t\t\t\t. \" AND \"\n\t\t\t\t\t\t. $db->quoteInto(\"sh.study_outcome_id = ?\", $outcomeId)\n\t\t\t\t\t. \")\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tif ($study[\"enthusiasm\"]) {\n\t\t\t\t$select->where(\"sh.level_enthusiasm = ?\", $study[\"enthusiasm\"]);\n\t\t\t}\n\t\t\t\n\t\t\tif ($study[\"outcome_id\"]) {\n\t\t\t\t$select->where(\"sh.study_outcome_id = ?\", $study[\"outcome_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\tif ($study[\"not_outcome_id\"]) {\n\t\t\t\t$select->where(\"sh.study_outcome_id != ?\", $study[\"not_outcome_id\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t\tCaller - POSSIBLE SEARCH PARAMATERS\n\t\t\t- caller_id\n\t\t\t- date\n\t\t\t- contact_type_id\n\t\t\t- contact_method\n\t\t\t- contact_outcome_id\n\t\t\t- callback date\n\t\t\t- study_id -> nothing if ALL\n\t\t\t- researcher_id -> nothing if ALL\n\t\t\t- lab_id -> nothing if ALL\n\t\t*/\n\t\t\n\t\tif (!(empty($data[\"caller\"]))) {\n\t\t\t$caller = $data[\"caller\"];\n\n\t\t\t// Join contact history\n\t\t\t$select\n\t\t\t\t->joinLeft(array('ch' => 'contact_histories'),\n\t\t\t\t\t'b.id <=> ch.baby_id', array())\n\t\t\t\t->joinLeft(array('s_ch' => 'studies'),\n\t\t\t\t\t'ch.study_id <=> s_ch.id', array())\n\t\t\t\t->joinLeft(array('r_ch' => 'researchers'),\n\t\t\t\t\t's_ch.researcher_id <=> r_ch.id', array());\n\t\t\t\n\t\t\t// Caller\n\t\t\tif (!empty($caller[\"caller_id\"])) {\n\t\t\t\t$select->where(\"ch.caller_id = ?\", $caller[\"caller_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Call date range\n\t\t\t$callFrom = trim($caller[\"date_from\"] . \" \" . $caller[\"time_from\"]);\n\t\t\t$callTo = trim($caller[\"date_to\"] . \" \" . $caller[\"time_to\"]);\n\t\t\tif (!empty($callFrom) and !empty($callTo)) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"ch.DATETIME\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($callFrom) . \" AS DATETIME)\")\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\tnew Zend_Db_Expr(\"CAST(\" . $db->quote($callTo) . \" AS DATETIME)\")\n\t\t\t\t);\n\t\t\t} elseif (!empty($callFrom)) {\n\t\t\t\t$select->where(\"ch.DATETIME = ?\", new Zend_Db_Expr(\"CAST(\" . $db->quote($callFrom) . \" AS DATETIME)\"));\n\t\t\t}\n\t\t\t\n\t\t\t// Contact Type\n\t\t\tif(!empty($caller[\"contact_type_id\"])) {\n\t\t\t\t$select->where(\"ch.contact_type_id = ?\", $caller[\"contact_type_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Contact Method\n\t\t\tif(!empty($caller[\"contact_method\"])) {\n\t\t\t\t$select->where(\"ch.contact_method = ?\", $caller[\"contact_method\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Contact Outcome\n\t\t\tif(!empty($caller[\"contact_outcome_id\"])) {\n\t\t\t\t$select->where(\"ch.contact_outcome_id = ?\", $caller[\"contact_outcome_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Callback date range\n\t\t\tif (!empty($caller[\"callback_date_from\"]) and !empty($caller[\"callback_date_to\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"ch.callback_date\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_date_from\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_date_to\"])\n\t\t\t\t);\n\t\t\t} elseif (!empty($caller[\"callback_date_from\"])) {\n\t\t\t\t$select->where(\"ch.callback_date = ?\", $caller[\"callback_date_from\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Callback time range\n\t\t\tif (!empty($caller[\"callback_time_begin\"]) and !empty($caller[\"callback_time_end\"])) {\n\t\t\t\t$select->where(\n\t\t\t\t\t\"ch.callback_time_begin\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_time_begin\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_time_end\"])\n\t\t\t\t\t\t. \" OR \" .\n\t\t\t\t\t\"ch.callback_time_end\"\n\t\t\t\t\t\t. \" BETWEEN \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_time_begin\"])\n\t\t\t\t\t\t. \" AND \" .\n\t\t\t\t\t\t\t$db->quote($caller[\"callback_time_end\"])\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\t// Study\n\t\t\tif (!empty($caller[\"study_id\"])) {\n\t\t\t\t$select->where(\"ch.study_id = ?\", $caller[\"study_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Researcher\n\t\t\tif (!empty($caller[\"researcher_id\"])) {\n\t\t\t\t$select->where(\"ch.researcher_id = ?\", $caller[\"researcher_id\"]);\n\t\t\t}\n\t\t\t\n\t\t\t// Lab\n\t\t\tif (!empty($caller[\"lab_id\"])) {\n\t\t\t\t$select->where(\"r_ch.lab_id = ?\", $caller[\"lab_id\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// Save query\n\t\t$query = $select->__toString();\n\t\t// Save records per page option (10 for now)\n\t\t$perPage = 50;\n\t\t\n\t\t// Get count of rows\n\t\t$select->reset(Zend_Db_Select::GROUP);\n\t\t$select->reset(Zend_Db_Select::COLUMNS);\n\t\t$select->from(null, \"COUNT(DISTINCT b.id) AS count\");\n\t\t$stmt = $select->query();\n\t\t$stmt->execute();\n\t\t$count = $stmt->fetchAll(Zend_Db::FETCH_COLUMN);\n\t\t$count = $count[0];\n\t\t\t\t\n\t\t// Send error if count is below 1\n\t\tif ($count < 1)\n\t\t\treturn False;\n\t\t\n\t\t// Have session with listType, rowCount, query, perPage\n\t\t$session = new Zend_Session_Namespace('query');\n\t\t$session->query = $query;\n\t\t$session->count = $count;\n\t\t$session->perPage = $perPage;\n\t\t\t\t\n\t\t// Send query, etc to list action\n\t\t$_SESSION[\"baby_search\"] = $params;\n\t\t$this->_forward(\"search-results\", \"baby\", null);\n\t}",
"public function report_bounce_list($params) {\n\t\t$request_url = \"{$this->url}&api_action=campaign_report_bounce_list&api_output={$this->output}&{$params}\";\n\t\t$response = parent::curl($request_url);\n\t\treturn $response;\n\t}",
"function showBeacons( ) {\n\t\t\t\n\t$arrBeacons = NagiosService::find_by_name('BEACON STATUS FILE');\n\t\n\t$arrOutput = array();\n\t\n\tforeach($arrBeacons as $idBeacon){\n\t\t\n\t\t$objBeacon = new NagiosService($idBeacon);\n\n\t\t$objNagiosServer = new NagiosServer($objBeacon->getNagiosServer());\n\t\t\t\t\n\t\t$arrOutput[] = array(\n\t\t\t'id' => $idBeacon,\n\t\t\t'name' => $objNagiosServer->getAlias(),\n\t\t\t'output' => $objBeacon->getField('plugin_output'),\n\t\t\t'hostname' => $objBeacon->getField('host_name'),\n\t\t\t'state' => $objBeacon->getField('current_state'),\n\t\t\t'updated' => $objBeacon->getField('last_hard_state_change'),\n\t\t\t'last_critical' => $objBeacon->getField('last_time_critical'),\n\t\t\t'last_warning' => $objBeacon->getField('last_time_warning'),\n\t\t);\n\t\t\n\t}\n\t\n\techo json_encode($arrOutput);\t\n\t\t\n\treturn true;\n\t\t\n}",
"function _callblast_content_default_fields() {\n $fields = array();\n\n // Exported field: field_blast_sent\n $fields[] = array(\n 'field_name' => 'field_blast_sent',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '3',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'number_integer',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'number',\n 'active' => '1',\n 'prefix' => '',\n 'suffix' => '',\n 'min' => '',\n 'max' => '',\n 'allowed_values' => '0|\r\n1|Blast sent',\n 'allowed_values_php' => '',\n 'widget' => array(\n 'default_value' => array(\n '0' => array(\n 'value' => NULL,\n ),\n ),\n 'default_value_php' => NULL,\n 'label' => 'Blast sent',\n 'weight' => '6',\n 'description' => '',\n 'type' => 'optionwidgets_onoff',\n 'module' => 'optionwidgets',\n ),\n );\n\n // Exported field: field_callblast_audio_eigh\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_eigh',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '14',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 8 message',\n 'weight' => '14',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_file\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_file',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '-2',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '1',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Main Message',\n 'weight' => '-2',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_five\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_five',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '11',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 5 message',\n 'weight' => '11',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_four\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_four',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '10',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 4 message',\n 'weight' => '10',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_nine\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_nine',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '15',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 9 message',\n 'weight' => '15',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_one\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_one',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '7',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 1 message',\n 'weight' => '7',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_options\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_options',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '6',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Options Message',\n 'weight' => '6',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_seve\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_seve',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '13',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 7 message',\n 'weight' => '13',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_six\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_six',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '12',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 6 message',\n 'weight' => '12',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_three\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_three',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '9',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 3 message',\n 'weight' => '9',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_two\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_two',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '8',\n 'parent' => 'group_options',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'mp3',\n 'file_path' => '',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Button 2 message',\n 'weight' => '8',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Exported field: field_callblast_audio_url\n $fields[] = array(\n 'field_name' => 'field_callblast_audio_url',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '-1',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'text',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'text',\n 'active' => '1',\n 'text_processing' => '0',\n 'max_length' => '',\n 'allowed_values' => '',\n 'allowed_values_php' => '',\n 'widget' => array(\n 'rows' => 5,\n 'size' => '60',\n 'default_value' => array(\n '0' => array(\n 'value' => '',\n '_error_element' => 'default_value_widget][field_callblast_audio_url][0][value',\n ),\n ),\n 'default_value_php' => NULL,\n 'label' => 'Main Message URL',\n 'weight' => '-1',\n 'description' => '',\n 'type' => 'text_textfield',\n 'module' => 'text',\n ),\n );\n\n // Exported field: field_callblast_call_forward\n $fields[] = array(\n 'field_name' => 'field_callblast_call_forward',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => 0,\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'text',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'text',\n 'active' => '1',\n 'text_processing' => '0',\n 'max_length' => '',\n 'allowed_values' => '',\n 'allowed_values_php' => '',\n 'widget' => array(\n 'rows' => 5,\n 'size' => '60',\n 'default_value' => array(\n '0' => array(\n 'value' => '',\n '_error_element' => 'default_value_widget][field_callblast_call_forward][0][value',\n ),\n ),\n 'default_value_php' => NULL,\n 'label' => 'Forward Call To',\n 'weight' => 0,\n 'description' => 'Enter a number for call forwarding. This is the number callers will be directed to when they press \"0\". (E.g. Press \"0\" to be connected with your state senator; press \"0\" to be connected with a staff person who can assist you with X; press \"0\" to speak with an operator.) ',\n 'type' => 'text_textfield',\n 'module' => 'text',\n ),\n );\n\n // Exported field: field_callblast_calllist\n $fields[] = array(\n 'field_name' => 'field_callblast_calllist',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '-4',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'callblast_list',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'text',\n 'required' => '1',\n 'multiple' => '0',\n 'module' => 'text',\n 'active' => '1',\n 'text_processing' => '0',\n 'max_length' => '',\n 'allowed_values' => '',\n 'allowed_values_php' => '',\n 'widget' => array(\n 'default_value' => array(\n '0' => array(\n 'value' => '',\n '_error_element' => 'value',\n ),\n ),\n 'default_value_php' => NULL,\n 'label' => 'Call List',\n 'weight' => '-4',\n 'description' => '',\n 'type' => 'callblast_calllist',\n 'module' => 'callblast',\n ),\n );\n\n // Exported field: field_callblast_end\n $fields[] = array(\n 'field_name' => 'field_callblast_end',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'label' => array(\n 'format' => 'above',\n 'exclude' => 0,\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'datestamp',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'date',\n 'active' => '1',\n 'granularity' => array(\n 'year' => 'year',\n 'month' => 'month',\n 'day' => 'day',\n 'hour' => 'hour',\n 'minute' => 'minute',\n 'second' => 'second',\n ),\n 'timezone_db' => 'UTC',\n 'tz_handling' => 'site',\n 'todate' => '',\n 'repeat' => 0,\n 'repeat_collapsed' => '',\n 'default_format' => 'medium',\n 'widget' => array(\n 'default_value' => 'blank',\n 'default_value_code' => '',\n 'default_value2' => 'same',\n 'default_value_code2' => '',\n 'input_format' => 'Y-m-d H:i:s',\n 'input_format_custom' => '',\n 'increment' => '1',\n 'text_parts' => array(),\n 'year_range' => '-3:+3',\n 'label_position' => 'above',\n 'label' => 'End Time',\n 'weight' => '8',\n 'description' => '',\n 'type' => 'date_select',\n 'module' => 'date',\n ),\n );\n\n // Exported field: field_callblast_scheduled_start\n $fields[] = array(\n 'field_name' => 'field_callblast_scheduled_start',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '-3',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'datestamp',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'date',\n 'active' => '1',\n 'granularity' => array(\n 'year' => 'year',\n 'month' => 'month',\n 'day' => 'day',\n 'hour' => 'hour',\n 'minute' => 'minute',\n ),\n 'timezone_db' => 'UTC',\n 'tz_handling' => 'site',\n 'todate' => '',\n 'repeat' => 0,\n 'repeat_collapsed' => '',\n 'default_format' => 'medium',\n 'widget' => array(\n 'default_value' => 'blank',\n 'default_value_code' => '',\n 'default_value2' => 'same',\n 'default_value_code2' => '',\n 'input_format' => 'm/d/Y - H:i:s',\n 'input_format_custom' => '',\n 'increment' => '1',\n 'text_parts' => array(),\n 'year_range' => '0:+1',\n 'label_position' => 'above',\n 'label' => 'Scheduled Start Time',\n 'weight' => '-3',\n 'description' => '',\n 'type' => 'date_select',\n 'module' => 'date',\n ),\n );\n\n // Exported field: field_callblast_script\n $fields[] = array(\n 'field_name' => 'field_callblast_script',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'weight' => '12',\n 'parent' => 'group_advanced',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'text',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'text',\n 'active' => '1',\n 'text_processing' => '0',\n 'max_length' => '',\n 'allowed_values' => '',\n 'allowed_values_php' => '',\n 'widget' => array(\n 'rows' => '5',\n 'size' => 60,\n 'default_value' => array(\n '0' => array(\n 'value' => '',\n '_error_element' => 'default_value_widget][field_callblast_script][0][value',\n ),\n ),\n 'default_value_php' => NULL,\n 'label' => 'Script',\n 'weight' => '12',\n 'description' => '',\n 'type' => 'text_textarea',\n 'module' => 'text',\n ),\n );\n\n // Exported field: field_callblast_start\n $fields[] = array(\n 'field_name' => 'field_callblast_start',\n 'type_name' => 'callblast',\n 'display_settings' => array(\n 'label' => array(\n 'format' => 'above',\n 'exclude' => 0,\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'datestamp',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'date',\n 'active' => '1',\n 'granularity' => array(\n 'year' => 'year',\n 'month' => 'month',\n 'day' => 'day',\n 'hour' => 'hour',\n 'minute' => 'minute',\n 'second' => 'second',\n ),\n 'timezone_db' => 'UTC',\n 'tz_handling' => 'site',\n 'todate' => '',\n 'repeat' => 0,\n 'repeat_collapsed' => '',\n 'default_format' => 'medium',\n 'widget' => array(\n 'default_value' => 'blank',\n 'default_value_code' => '',\n 'default_value2' => 'same',\n 'default_value_code2' => '',\n 'input_format' => 'Y-m-d H:i:s',\n 'input_format_custom' => '',\n 'increment' => '1',\n 'text_parts' => array(),\n 'year_range' => '-3:+3',\n 'label_position' => 'above',\n 'label' => 'Start Time',\n 'weight' => '7',\n 'description' => '',\n 'type' => 'date_select',\n 'module' => 'date',\n ),\n );\n\n // Exported field: field_callblast_message\n $fields[] = array(\n 'field_name' => 'field_callblast_message',\n 'type_name' => 'callblast_message',\n 'display_settings' => array(\n 'weight' => '31',\n 'parent' => '',\n 'label' => array(\n 'format' => 'above',\n ),\n 'teaser' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'full' => array(\n 'format' => 'swftools_no_file',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'wav mp3',\n 'file_path' => 'callblast',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'label' => 'Call Blast Message',\n 'weight' => '31',\n 'description' => '',\n 'type' => 'filefield_widget',\n 'module' => 'filefield',\n ),\n );\n\n // Translatables\n array(\n t('Blast sent'),\n t('Button 1 message'),\n t('Button 2 message'),\n t('Button 3 message'),\n t('Button 4 message'),\n t('Button 5 message'),\n t('Button 6 message'),\n t('Button 7 message'),\n t('Button 8 message'),\n t('Button 9 message'),\n t('Call Blast Message'),\n t('Call List'),\n t('End Time'),\n t('Forward Call To'),\n t('Main Message'),\n t('Main Message URL'),\n t('Options Message'),\n t('Scheduled Start Time'),\n t('Script'),\n t('Start Time'),\n );\n\n return $fields;\n}",
"function getPorductNamesByBrand(){\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n\n if(!empty($_POST)){\n $type = $_POST['type'];\n $brand = $_POST['brand'];\n\n $ret['content'] = $this->product_model->getProductList($type, $brand);\n if($ret['content'] != NULL) $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }",
"public function globalclubbingsearchlist($user_id)\n {\n $em = $this->doctrine->getManager();\n $request = $this->request->getCurrentRequest();\n\n $queryBuilder = $em->createQueryBuilder();\n $queryBuilder->select('pfk.id', 'pfk.searchKeyword','pfk.timestamp');\n $queryBuilder\n ->from('IFlairSoapBundle\\Entity\\Partytypekeyword', 'pfk')\n ->where(\"pfk.userId = $user_id\")\n ->orderBy('pfk.timestamp', 'DESC')\n ->setMaxResults('3');\n $result = $queryBuilder->getQuery()->getResult();\n \n $latest_user_search = array();\n foreach($result as $data)\n {\n $latest_user_search[] = $data['searchKeyword'];\n }\n /* Trending Data */\n $queryBuilder1 = $em->createQueryBuilder();\n $queryBuilder1->select('pf.id', 'pf.clubTitle', 'pfi.imageName');\n $queryBuilder1->addSelect('count(pf.id) as partycount')\n ->from('IFlairSoapBundle\\Entity\\Partytypesearch', 'pts')\n ->leftJoin('IFlairSoapBundle\\Entity\\Partyfinder', 'pf', Expr\\Join::WITH, 'pf.id = pts.partyFinderId')\n ->leftJoin('IFlairSoapBundle\\Entity\\Partyfinderimage', 'pfi', Expr\\Join::WITH, 'pfi.partyFinderId = pf.id')->where(\"pfi.imageType = 'logo'\")->groupBy('pf.id')\n ->addOrderby('partycount', 'DESC');\n $trending_party = $queryBuilder1->getQuery()->getResult();\n $image_path = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath().'/bundles/iflairsoap/images/';\n $trending_data = array();\n $count = 0;\n $global_clubbing_id = array();\n foreach($trending_party as $trend)\n {\n $global_clubbing_id[] = $trend['id'];\n $trending_data[$count] = $trend;\n $trending_data[$count]['imageName'] = $image_path.$trend['imageName'];\n $count++;\n }\n\n $city_sequence = array();\n $count = 0;\n foreach($global_clubbing_id as $id)\n {\n $partyfinder = $em->getRepository('IFlairSoapBundle:Partyfinder')->findById($id);\n foreach($partyfinder as $club)\n {\n $partyfinder_city = $em->getRepository('IFlairSoapBundle:Partyfinderlocation')->findById($club->getClubLocationId()->getId());\n foreach($partyfinder_city as $city)\n {\n $city_sequence[$count]['city_name'] = $city->getCityId()->getCityName();\n $partyfinder_country_names = $em->getRepository('IFlairSoapBundle:Partyfindercountry')->findById($city->getCityId()->getCountryId()->getId());\n $image_path = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath().'/bundles/iflairfestival/images/country/';\n foreach($partyfinder_country_names as $country)\n {\n $city_sequence[$count]['country_image'] = $image_path.strtolower(str_replace(' ', '_', $country->getCountryName())).'.png';\n }\n }\n }\n $count++;\n }\n \n $myresponse = array(\n 'success' => true,\n 'status' => Response::HTTP_OK,\n 'latest_user_search' => $latest_user_search,\n 'trending_data' => $trending_data,\n 'city_data' => $city_sequence\n );\n $finalResponse = json_encode($myresponse);\n return $finalResponse;\n }",
"function getBusList()\n\t\t {\n\t\t App::import('model','AdvertiserProfile');\n\t\t $this->ad_pro = new AdvertiserProfile(); \n\t\t\t\n\t\t\t$BusnessesList = $this->ad_pro->find('list', array('fields' => array('id', 'company_name'),'order' => 'id ASC','recursive' => -1,'conditions' => array('publish' => 'yes'))); \n\t\t\treturn $BusnessesList;\n\t\t }",
"public function prepareBrands() {\n\n $response = [];\n if (empty($this->brands)) {\n return $this->jsonErrorResponse($this->getMessageData('error', $this->lang)['no_records_found']);\n }\n foreach ($this->brands as $key => $category) {\n $response[$key]['uuid'] = $category->uuid;\n $response[$key]['slug'] = $category->slug;\n $response[$key]['title'] = $this->lang == 'ar' ? $category->ar_title : $category->en_title;\n $response[$key]['image'] = !empty($category->image) ? $category->image : 'Category_5daf2155ba6481571758421.jpg';\n }\n return $response;\n }",
"public function getCatalogSearchFiltersAction()\r\n {\r\n $data = Mage::getModel('emapi/filters')->klevuSearchFilters($this);\r\n header(\"Content-Type: application/json\");\r\n echo json_encode($data);\r\n exit;\r\n }",
"public function getScrapedBrandAndBrandRaw(Request $request)\n {\n $supplierId = $request->id;\n\n $supplier = Supplier::find($supplierId);\n if ($supplier->scraped_brands != '') {\n $scrapedBrands = array_filter(explode(',', $supplier->scraped_brands));\n\n sort($scrapedBrands);\n } else {\n $scrapedBrands = array();\n }\n\n if ($supplier->scraped_brands_raw != '') {\n $rawBrands = array_unique(array_filter(array_column(json_decode($supplier->scraped_brands_raw, true), 'name')));\n\n sort($rawBrands);\n } else {\n $rawBrands = array();\n }\n\n return response()->json(['scrapedBrands' => $scrapedBrands, 'scrapedBrandsRaw' => $rawBrands], 200);\n }",
"function getBrandListByTypeID(){\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if(!empty($_POST)){\n $type = $_POST['type'];\n\n $ret['content'] = $this->product_util_model->getProductBrandList($type);\n if($ret['content'] != NULL) $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }",
"public function getFiltersList(){\n return $this->_get(1);\n }",
"public function getFiltersList(){\n return $this->_get(1);\n }",
"public function getTrueyouBrands()\n {\n // Get via PCMS API\n $params = array();\n $response = $this->pcmsClient->api(\"brands/trueyou\", $params, 'GET');\n $responseData = empty($response['data']) ? array() : $response['data'] ;\n\n return $responseData;\n }",
"public function setupBundleList()\n {\n if (! Guard::verifyAjaxNonce('cuztom', 'security')) {\n return;\n }\n\n $data = [];\n $bundle = self::getField();\n\n if (Cuztom::isArray($bundle->data)) {\n foreach ($bundle->data as $item) {\n $data[] = $item->output();\n }\n }\n\n echo (new Response(true, $data))->toJson();\n\n // wp\n exit;\n }",
"private function browseRecommendations() {\n if(IS_DEVELOPMENT){\n $startTime = microtime(true);\n }\n $filters = json_decode($this->input->post('filters'), true);\n $browsePage = $filters['browsePage']['value'] !== null ? $filters['browsePage']['value'] : 0;\n $pageSize = $filters['pageSize']['value'] !== null ? $filters['pageSize']['value'] : 10;\n $offSet = $filters['pageSize']['value'] * ($filters['browsePage']['value'] - 1);\n $sortColumn = $filters['sortColumn']['value'] !== null ? $filters['sortColumn']['value'] : \"dateAdded\";\n $sortDirection = $filters['sortDirection']['value'] !== null ? $filters['sortDirection']['value'] : \"DESC\";\n $manageRecommendationsApiVersion = $this->input->post('manageRecommendationsApiVersion');\n $filter = array(\n 'type' => '',\n 'offSet' => $offSet,\n 'pageNumber' => $browsePage,\n 'pageSize' => $pageSize,\n 'sortColumnId' => $sortColumn,\n 'sortDirection' => $sortDirection,\n 'manageRecommendationsApiVersion' => $manageRecommendationsApiVersion\n );\n $recommendationsResult = $this->model('Okcs')->getRecommendationsSortedBy($filter);\n if($recommendationsResult->errors) {\n $response = $this->getResponseObject($recommendationsResult);\n }\n else {\n $response = array(\n 'recommendations' => $recommendationsResult->items,\n 'filters' => '',\n 'columnID' => $sortColumn,\n 'sortDirection' => $sortDirection,\n 'hasMore' => $recommendationsResult->hasMore,\n 'currentPage' => $browsePage\n );\n }\n if(IS_DEVELOPMENT){\n $timingArray = $this->calculateTimeDifference($startTime, 'browseRecommendations | OkcsAjaxRequestController');\n $response['ajaxTimings'] = $timingArray;\n }\n $this->_renderJSON($response);\n }"
] | [
"0.5859157",
"0.5823545",
"0.5639915",
"0.5454363",
"0.5448288",
"0.5386113",
"0.53603905",
"0.51938367",
"0.5179481",
"0.517614",
"0.513907",
"0.5083545",
"0.5072111",
"0.50608945",
"0.5048054",
"0.50458175",
"0.5043165",
"0.5020881",
"0.5006851",
"0.49979138",
"0.4996077",
"0.4995863",
"0.49884275",
"0.49827775",
"0.49581113",
"0.4952288",
"0.4952288",
"0.49387425",
"0.49353802",
"0.49281445"
] | 0.6866326 | 0 |
Realtionship with model SlideShowImage | public function image() {
return $this->belongsTo(SlideShowImage::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imageSliderAction() {\n $sliders = Mage::getResourceModel('slider/slider_collection')->addFilter('status', 1);\n $sliders_data = $sliders->getData();\n $imgpath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'slider/image';\n //Title = Product or Category\n //URL = Product ID or Category ID\n // Image = image path\n $res = array(\"images\" => $sliders_data, \"imgpath\" => $imgpath);\n // $this->response($this->json($res), 200);\n $jsonData = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($res));\n }",
"public function manageSliderImage()\n {\n $sliders= Slider::all();\n return view('frontEnd.slide.manageSlider',['sliders'=>$sliders]);\n }",
"function imagesslider()\n\t{\n\t\tcek_session_akses('imagesslider', $this->session->id_session);\n\t\t$data['record'] = $this->Model_main->slide();\n\t\t$data['title'] = \"Images Slider\";\n\t\t$data['identitas_web'] = $this->Model_main->identitas()->row_array();\n\t\t$this->template->load('administrator/template', 'administrator/mod_slider/view_slider', $data);\n\t}",
"public function images();",
"public function images();",
"public function img(){\n return $this->morphOne('App\\Models\\Img', 'imageable');\n }",
"static function showImageSlide($params)\n\t{\n\t\t$original_image = JURI::root() . $params->get('firstimage'); \n\t\t$sliding_image = JURI::root() . $params->get('secondimage'); \n\t\t$rowamount = $params->get('rowamount');\n\t\t$SlideInfo = array(\n\t\t\t\"original_image\" => $original_image, \n\t\t\t\"sliding_image\" => $sliding_image, \n\t\t\t\"rowamount\" => $rowamount\n\t\t\t);\n\t\treturn $SlideInfo; \n\t}",
"public function getImage () {}",
"public function flopImage () {}",
"public function getImageScene () {}",
"public function get_Images_Slider(){\n $this->objConection->conexion();\n $queryImg = \"CALL image_SP(0, null, 0, 0, $this->id_New, 'SELECT');\";\n $resultadoImg = $this->objConection->cone->query($queryImg);\n while($rowImg = $resultadoImg->fetch_assoc()){ ?>\n <li>\n <img src=\"<?php echo \"controllers/\" . $rowImg['image'];?>\" height=400 width=500>\n </li>\n <?php\n }\n }",
"public function getImageMatte () {}",
"public function getImage() {\n\t}",
"public function image(){\n return $this->morphOne('App\\Models\\Image', 'imageable');\n }",
"public function imageable(){\n //Le decimos que nos retorne una relacion polimorfica\n return $this->morphTo();\n }",
"public function images(){\n return $this->morphMany('App\\Models\\Image','imageable');\n }",
"public function getImage() { return $this->image;}",
"public function mosaicImages () {}",
"function Image_CT_model ()\r\n\t{\r\n\t\tparent::Content_model('image');\r\n\t}",
"public function getPisturesSlider(){\n\t\t$sliderPicture = DB::table('pictures')->get();\n\t\treturn $sliderPicture;\n }",
"public function getImageScene() {\n\t}",
"protected function getPicture()\n {\n\n }",
"public function getPicture()\n{\nreturn $this->picture;\n}",
"public function enhanceImage () {}",
"public function flopImage() {\n\t}",
"public function image()\n {\n //return $this->morphOne(related: Image::class, name: 'imageable' );\n return $this->morphOne('App\\Models\\Image', 'imageable');\n }",
"public function magnifyImage () {}",
"function staticSlides() {\n\n\t\t$slide = get_sub_field('slide');\n\n\t\t$i = 0;\n\n\t\tforeach ($slide as $s) {\n\t\t\t$data[$i]['content'] = $s[\"content\"];\n\t\t\t$data[$i]['large_img'] = $s[\"large_image\"][\"url\"];\n\t\t\t$data[$i]['small_img'] = $s[\"small_image\"]; \n\n\t\t\t// skip to the bottom to see a sample of what this will produce\t\t\n\n\t\t\t$i++;\n\t\t}\n\n\t\treturn $data;\n\n\t}",
"public function mosaicImages() {\n\t}",
"public function publishSlides()\n {\n $slides = SlideImage::get();\n $ct = 0;\n foreach ($slides as $slide) {\n if ($slide->ShowSlide == 1) {\n if (!$slide->Name) {\n $slide->Name = ($slide->Headline) ? $slide->Headline : 'New Slide';\n }\n $slide->writeToStage('Stage');\n $slide->publish('Stage', 'Live');\n echo '<p>' . $slide->Name . '</p>';\n ++$ct;\n }\n }\n echo '<h3>'.$ct.' slides updated.</h3>';\n }"
] | [
"0.63574934",
"0.633313",
"0.6300499",
"0.6298024",
"0.6298024",
"0.62316126",
"0.61327374",
"0.61090374",
"0.6080424",
"0.6079276",
"0.6053357",
"0.59697413",
"0.5968848",
"0.5950196",
"0.59478676",
"0.59382546",
"0.5933356",
"0.5925482",
"0.5920181",
"0.591486",
"0.59146756",
"0.5909384",
"0.59084535",
"0.589335",
"0.5892501",
"0.58774376",
"0.5868083",
"0.58659875",
"0.58494323",
"0.5846456"
] | 0.7106633 | 0 |
Our billable model's table name must be set in here for usage of tables. | public function __construct()
{
$billableModelName = config('iyzipay.billableModel');
$this->billableTableName = (new $billableModelName)->getTable();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function tableName(): string \n {\n return static::TABLE;\n }",
"private function setTableName()\n {\n if (!empty($this->table))\n return;\n\n $ns = trim(get_class($this), \"\\\\\");\n if (strpos($ns, \"\\\\\")) {\n $parts = explode(\"\\\\\", $ns);\n if (reset($parts) == 'models')\n array_shift($parts);\n $parts = array_map('ucfirst', $parts);\n } else {\n $parts = [$ns];\n }\n\n $table = \\helpers\\Utils::snake_case(implode($parts));\n if (in_array($table, self::$tables[$this->configKey])) {\n $this->table = $table;\n return;\n }\n\n $table = \\helpers\\Utils::snake_case(array_pop($parts));\n if (in_array($table, self::$tables[$this->configKey])) {\n $this->table = $table;\n return;\n }\n\n trigger_error('Missing table name in model class ' . get_class($this), E_USER_WARNING);\n }",
"public static function getTableName()\n\t{\n\t\treturn 'b_tasks_reminder';\n\t}",
"protected function TableName() {\n\treturn 'cust_cards';\n }",
"public function getTableName()\n {\n return 'user';\n }",
"public function getTableName()\n {\n return 'user';\n }",
"public function GetTableName ()\n {\n return static::TABLE_NAME;\n }",
"public function getTableName()\n {\n return \"item_car\";\n }",
"public function getTable() {\n $this_model = get_sub_classes(Model::class);\n $table_from_class = explode('\\\\', end($this_model));\n return isset($this->table) ? $this->table : to_snakecase(end($table_from_class));\n }",
"private function setTable()\n {\n $this->table = strtolower($this->entity);\n }",
"public function _tableName() {\n return 'person_queue';\n }",
"private function _fetch_table()\n {\n if ($this->_table === NULL)\n $this->_table = plural(preg_replace('/_model$/', '', strtolower(get_class($this))));\n }",
"protected function _setupTableName(){\n\n if( !$this->_name ){\n\t\t\t$name = str_replace( \"_Model_DbTable\", \"\", get_class( $this ) );\n\t\t\tlist( $module, $item ) = explode( \"_\", $name );\n\t\t\tif( preg_match_all( '|[A-Z]+([a-z])*|', $item, $matches ) &&\n\t\t\t\tcount( $matches[ 0 ] > 1 ) ){\n\t\t\t\t$item = implode( \"_\", $matches[ 0 ] );\n\t\t\t\tif( \"R\" != end( $matches[ 0 ] ) ){\n\t\t\t\t\t$item = Go_Misc::plural( $item ); \n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_name = strtolower( $module . \"_\" . $item );\n\n }\n parent::_setupTableName();\n }",
"public static function getTableName()\n {\n return 'ibc_book';\n }",
"private function _getTableName()\n {\n $class = get_called_class();\n $bits = explode('_', $class);\n $model = sprintf('%s_%s', \n strtolower($bits[0]), \n str_replace('model', '', strtolower($bits[1]))\n );\n\n return String::plural($model);\n }",
"function getTableName()\n\t{\n\t\treturn $this->_tbl;\n\t}",
"public function getTable() {return $this->_table;}",
"public function getTableName () {\r\n\t\treturn 'user_accountManager';\r\n\t}",
"public function model()\n {\n return BillPay::class;\n }",
"protected function _setupTableName() {\n $this->_name = Zend_Registry::get('config')->resources->db->prefix . 'items';\n parent::_setupTableName();\n }",
"function getTableName() {\n return \"blogtable\";\n }",
"static public function get_table_name() {\n return static::$tableName;\n }",
"public static function getTableName(): string\n\t{\n\t\treturn 'b_im_option_user';\n\t}",
"public function table($table_name)\n {\n return Mage::getSingleton('core/resource')->getTableName($table_name);\n }",
"abstract public function get_table_name();",
"public static function getTableName()\n\t{\n\t\treturn 'salerman_kcm_supply';\n\t}",
"abstract protected function getTableName();",
"abstract protected function getTableName();",
"abstract protected function getTableName();",
"public static function getTableName()\n {\n return 'b_smartcat_connector_profile_iblock';\n }"
] | [
"0.66927963",
"0.66911757",
"0.6605905",
"0.65807885",
"0.6521442",
"0.6521442",
"0.6514054",
"0.6510169",
"0.64973116",
"0.64961493",
"0.646517",
"0.6452645",
"0.6441301",
"0.64369804",
"0.6420042",
"0.6393883",
"0.6384242",
"0.6349146",
"0.63471025",
"0.6346639",
"0.63424724",
"0.633817",
"0.63345504",
"0.6331529",
"0.63309896",
"0.6329828",
"0.6328544",
"0.6328544",
"0.6328544",
"0.6322344"
] | 0.73665696 | 0 |
Metoda per carregar el formulari de insert per categoria | public function formCreate() {
require_once('views/categoria/formInsert.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insertarDatos() {\n\t\t$nombre = $this->input->post('nombre_categoria');\n\t\t//Llamamos al modelo para insertarlo\n\t\t$this->categoria_model->insertarCategoria($nombre);\n\t\t$this->obtenerdatos();\n\t}",
"function insertar_categoria(){\n\t\t$this->accion=\"Datos de Categoría\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT * FROM categoria WHERE nombre_cat='$this->nombre' AND padre_cat='$this->padre'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\tif($resultado=mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=1;\n\t\t\t}else{\n\t\t\t\t$sql=\"INSERT INTO categoria VALUES (NULL, '$this->nombre', '$this->etiqueta', '$this->prioridad', '$this->padre')\";\n\t\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\theader(\"location:/admin/categoria/\");\n\t\t\t}\n\t\t}\n\t\t$this->crearArbol('categoria','id_cat','nombre_cat','padre_cat',0,'—');\n\t}",
"public function registrarCateg($post){\n $datosCategoria = Array();\n $datosCategoria['nombretipomaterial'] = $post['nombrecategoria'];\n $this->db->insert('tipomaterial', $datosCategoria);\n }",
"public function categories(){\n\t\tif($_POST){\n\t\t\t$validateForm = form_check('categories');\n\t\t\tif($validateForm['error']){\n\t\t\t\t$values = count($_POST['cat_value']) >= 1 ? implode(',', $_POST['cat_value']) : '';\n\t\t\t\t$this->crud->insert('categories', array('cat_name' => $_POST['cat_name'], 'cat_value' => $values));\n\t\t\t\t$validateForm['toast'] = \"Gotcha, votre nouvelle cotisation à été bien ajoutée\";\n\t\t\t}else{\n\t\t\t\t$validateForm['toast'] = 'Une ou plusieurs erreurs ont été constaté veuillez verifier votre formulaire';\n\t\t\t}\n\t\t\techo json_encode($validateForm);\n\t\t}else{\n\t\t\tshow_404();\n\t\t}\n\t}",
"public function inserimentotipologiaAction(){\n \n $this->_logger->info('Attivato ' . __METHOD__ . ' ');\n \n \n if (!$this->getRequest()->isPost()) {\n $this->_helper->redirector('home');\n }\n $formInserimentoTipologia = $this->_formInserimentoTipologia;\n \n if (!$formInserimentoTipologia->isValid($_POST)){\n \n\n $formInserimentoTipologia->setDescription('Attenzione: alcuni dati inseriti sono errati.');\n $this->_logger->debug(print_r($formInserimentoTipologia->getErrors(), true));\n return $this->render('nuovatipologia');\n \n \n }\n \n $values = $formInserimentoTipologia->getValues();\n $this->_AdminModel->insertTipologia($values);\n $this->_helper->redirector('index');\n }",
"public function create() {\n if (!isset($_POST['nom'])){\n return call('pages', 'error');\n }\n \n Categoria::insert($_POST['nom'], $_POST['sub_categoria']);\n\n require_once('views/categoria/formInsert.php');\n }",
"public function sql_insert()\n\t{\n\t\tparent::sql_insert();\n\t\tif (!is_null($this->categories))\n\t\tforeach ($this->categories as $cat) {\n\t\t\tCategorizedItem::add($cat, $this->slug);\n\t\t}\n\t}",
"public function set_insert_form() {\n\n if($this->table2) {\n $this->table = $this->table1;\n $tbl1_field = $this->query_assoc(\"datatype_sql\");\n $tbl1_pri_val = $this->query_assoc(\"autoincrement_sql\");\n\n $this->table = $this->table2;\n $tbl2_field = $this->query_assoc(\"datatype_sql\");\n $tbl2_pri_val = $this->query_assoc(\"autoincrement_sql\");\n\n $this->display_insert_form($tbl1_field, $tbl1_pri_val, $this->table1);\n $this->display_insert_form($tbl2_field, $tbl2_pri_val, $this->table2);\n }\n else {\n $this->table = $this->table1;\n $tbl1_field = $this->query_assoc(\"datatype_sql\");\n $tbl1_pri_val = $this->query_assoc(\"autoincrement_sql\");\n\n $this->display_insert_form($tbl1_field, $tbl1_pri_val, $this->table1);\n } \n }",
"function event_postcondicionInsert($sNombreFormulario, $dbVars, $formVars)\n {\n switch ($sNombreFormulario) {\n case \"SUBIR_ARCHIVO\":\n }\n }",
"public function insertValues($form)\n {\n }",
"function insertarCategoria(){\n\t\t$this->procedimiento='cd.ft_categoria_ime';\n\t\t$this->transaccion='CD_CAT_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('monto','monto','numeric');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_tipo_categoria','id_tipo_categoria','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function save(){\n Utils::isAdmin();\n if(isset($_POST) && isset($_POST['nombre'])){\n /* GUARDAREMOS CATEGORIAS */\n $categoria= new Categoria();\n $categoria->setNombre($_POST['nombre']); \n\n /* ESTE IF NOS PERMITIRA REUTILIZAR ESTE METODO save() YA QUE LOGRAREMOS IDENTIFICAR\n SI NOS LLEGA POR $_GET[''] ESTO LO HACEMOS ATRAVES DE LOS DATOS QUE LLEGAN EL FORMULARIO\n views/categoria/crear.php \n */\n if(isset($_GET['id'])){\n /* SI DENTRAMOS POR MEDIO DE GET[] ENTRAREMOS A MODIFICAR LA CATEGORIA */\n $id = $_GET['id']; //ID QUE NOS LLEGA, ASI SE SABRA QUE CATEGORIA MODIFICAREMOS\n $categoria -> setId($id); //\n $save = $categoria->edit(); //METODO PARA MODIFICAR CATEGORIA models/categoria.php\n }else{\n $categoria->save(); //METODO PARA GUARDAR CATEGORIA models/categoria.php\n } \n if($save){\n /* SI TODO ESTA CORRECTO CREARA UNA SECCION, SI NO MOSTRARA UNA SECCION ERRONEA */\n $_SESSION['producto'] = \"complete\"; \n }else{\n $_SESSION['producto'] = \"failed\";\n }\n }else{\n $_SESSION['producto'] = \"failed\";\n }\n header('Location:'.base_url.'categoria/index');\n }",
"function insert() {\n\t\t\t$cat = $_POST['id_categoria'];\n\t\t\t$sub = $_POST['sub_categoria'];\n\t\t\tif (!empty($cat) and !empty($sub)) {\n\t\t\t\t$obj = new SubCatDTO($sub, $cat);\n\t\t\t\t$json = SubCatDAO::insert($obj);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$json = ['ok' => false, 'error' => 'Faltan datos por ingresar'];\n\t\t\t}\n\n\t\t\tprint(json_encode($json));\t\n\t\t}",
"public function addForm() {\r\n $listCategories = $this->model->getCategories();\r\n $this->view->addForm($listCategories);\r\n }",
"public function insert($tblForm2550m);",
"public function createCategoria()\n {\n $categoria = new Categoria();\n $categoria->setCategoriaNome('DIY');\n $categoria->setCategoriaDescricao('Do It Yourself');\n $categoria->save();\n }",
"public function insert()\n\t{\n\t\t$this->Tipomedidadistancia_model->descricao = $this->input->post('cnometmd');\n\t\t$this->Tipomedidadistancia_model->sigla = $this->input->post('csiglatmd');\n\t\tif ($this->Tipomedidadistancia_model->validaInsercao()){\n\t\t\t$this->Tipomedidadistancia_model->save();\n\t\t\t$this->session->set_flashdata('sucesso','Tipo cadastrado com sucesso');\n\t\t\tredirect(makeUrl('dci','tipomedidadistancia','visualizar'));\n\t\t} else {\n\t\t\t$this->session->set_flashdata('erro',$this->Tipomedidadistancia_model->error);\n\t\t\t$this->session->set_flashdata('cnometmd',$this->Tipomedidadistancia_model->descricao);\n\t\t\t$this->session->set_flashdata('csiglatmd',$this->Tipomedidadistancia_model->sigla);\n\t\t\tredirect(makeUrl('dci','tipomedidadistancia','inserir'));\n\t\t\treturn;\n\t\t}\n\t}",
"function add_new_keywords_one_category($category){\r\n\tglobal $error, $errorText ;\r\n\t$feild = '';\r\n\tswitch($category){\r\n\t\tcase KEYWORD_LOCATION_CAT: $field = 'locations_added';break;\r\n\t\tcase KEYWORD_PERSON_CAT: $field = 'persons_added';break;\r\n\t\tcase KEYWORD_MISC_CAT: $field = 'misc_added';break;\r\n\t\tcase KEYWORD_GENRE_CAT: $field = 'genres_added';break;\r\n\t\tcase KEYWORD_SYSTEM_CAT: $field = 'systems_added';break;\r\n\t\tdefault: $field = 'themes_added';break;\r\n\t}\r\n\t\r\n\t//get information which will be regisreted in inb_themes\r\n\t\t//idt: automatic\r\n\t\t//for any keyword type, we get the information from $_POST[$field]\r\n\t\tif($_POST[$field] != ''){\r\n\t\t\t$tab = explode(\",\",$_POST[$field]);//they separated by a coma, we turn the string into an array\r\n\t\t\tforeach($tab as $one){//we add keywords one by one\r\n\t\t\t\tif ($one!='') {\r\n\t\t\t\t\t$query = sprintf(\"INSERT INTO inb_keywords(id,category,keyword) VALUES('','%d','%s')\",$category,$one);\r\n\t\t\t\t\t$request = mysql_query($query);\r\n\t\t\t\t\tif(!($request)){\r\n\t\t\t\t\t\t$errorText .= \"An error has occurred during the registering (level 2.\".$category.\") into the database: <br />\".mysql_error().\"<br /> \";\r\n\t\t\t\t\t\t$error = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n}",
"public function createForm(){\n\n\t\t//Inserção dos tipos de Campos\n\t\t$this->dboKrs->sqlExec('TRUNCATE tipo_campo CASCADE');\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'1','tpcadesc'=>\"TEntry\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'2','tpcadesc'=>\"TCombo\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'3','tpcadesc'=>\"TRadioGroup\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'4','tpcadesc'=>\"TMultiSelect\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'5','tpcadesc'=>\"TButton\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'6','tpcadesc'=>\"TPassword\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'7','tpcadesc'=>\"THidden\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'8','tpcadesc'=>\"TFrameFile\"));\n\t\t$this->insertKrs('tipo_campo',array('seq'=>'9','tpcadesc'=>\"TText\"));\n\t\t\n\t\tforeach($this->entidades as $table=>$entidade){\n\t\t\t$form = array();\n\t\t\t$form[\"formid\"] = substr('form_'.$table,0,30);\n\t\t\t$form[\"nomeform\"] = $table;\n\t\t\t$form[\"tabseq\"] = $entidade[\"tabseq\"];\n\t\t\t$form[\"formainclude\"] = \"one\";\n\t\t\t$form[\"botconcluir\"] = \"1\";\n\t\t\t$form[\"botcancelar\"] = \"1\";\n\t\t\t$form[\"formoutcontrol\"] = \"0\";\n\t\t\t$form[\"autosave\"] = \"0\";\n\t\t\t$form[\"nivel\"] = \"1\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$retInsert = $this->insertKrs(\"forms\", $form);\n\t\t\t$this->entidades[$table]['formseq'] = $retInsert['seq'];\n\t\t\t\n\t\t\t//Vincula form à tabela\n\t\t\t$formTabela = array();\n\t\t\t$formTabela['formseq'] = $retInsert['seq'];\n\t\t\t$formTabela['tabseq'] = $entidade['tabseq'];\n\t\t\t$this->insertKrs('form_x_tabelas', $formTabela);\n\n\t\t\t// Gerar uma aba (Gerar Privilegio)\n\t\t\t$aba = array();\n\t\t\t$aba['abaid'] = substr('aba_'.$table,0,30);\n\t\t\t$aba['nomeaba'] = $table;\n\t\t\t$aba['obapendice'] = '-';\n\t\t\t$aba['action'] = '-';\n\t\t\t$aba['impressao'] = '1';\n\t\t\t$aba['ordem'] = '1';\n\t\t\t\n\t\t\t$retInsertAba = $this->insertKrs('abas', $aba);\n\n\t\t\t$formAba = array();\n\t\t\t$formAba['formseq'] = $retInsert['seq'];\n\t\t\t$formAba['abaseq'] = $retInsertAba['seq'];\n\t\t\t$formAba['ordem'] = '1';\n\t\t\t$this->insertKrs('form_x_abas', $formAba);\n\t\t\t\n\t\t\t\n\t\t\t// Gerar um bloco (Gerar Privilegio)\n\t\t\t$bloco = array();\n\t\t\t$bloco['blocoid'] = substr('bloco_'.$table,0,30);\n\t\t\t$bloco['nomebloco'] = $table;\n\t\t\t$bloco['formato'] = 'frm';\n\t\t\t$bloco['tabseq'] = $entidade[\"tabseq\"];\n\t\t\t$bloco['blocoheight'] = '200px';\n\t\t\t$bloco['frmpseq'] = $retInsert['seq'];\n\t\t\t\n\t\t\t$retInsertBloco = $this->insertKrs('blocos', $bloco);\n\t\t\t$blocoSeq = $retInsertBloco['seq'];\n\t\t\t\n\t\t\t$blocoAba = array();\n\t\t\t$blocoAba['abaseq'] = $retInsertAba['seq'];\n\t\t\t$blocoAba['blocseq'] = $retInsertBloco['seq'];\n\t\t\t$blocoAba['ordem'] = '1';\n\t\t\t$this->insertKrs('blocos_x_abas', $blocoAba);\n\t\t\t\n\t\t\t//Obtem Foregin Keys para criação de lista de pesquisas\n\t\t\t$listFks = $this->getForeignKeys($this->tableNames[$table]);\n\t\t\t\n\t\t\t// Gerar todos os campos (Gerar Privilegio)\n\t\t\t$count = 1;\n\t\t\tforeach($this->tableEstructures[$table] as $col => $dataCol){\n\t\t\t\t$campo = array();\n\t\t\t\t$campo['colunadb'] = $col;\n\t\t\t\t$campo['campo'] = 'campo_'.$col;\n\t\t\t\t$campo['label'] = $col.\":\";\n \t\t\t\t$campo['tpcaseq'] = '1';\n\t\t\t\t$campo['tabseq'] = $entidade[\"tabseq\"];\n\t\t\t\t$campo['ativafunction'] = '1';\n\t\t\t\t$campo['ativapesquisa'] = '0';\n\t\t\t\t$campo['valorpadrao'] = '-';\n\t\t\t\t$campo['outcontrol'] = '-';\n\t\t\t\t$campo['incontrol'] = '0';\n\t\t\t\t$campo['trigger'] = '0';\n\t\t\t\t$campo['help'] = '';\n\t\t\t\t$campo['valornull'] = $dataCol->required ? '1':'0';\n\t\t\t\t$campo['alteravel'] = $col == 'seq'? '0':'1';\n\t\t\t\t$campo['autosave'] = '0';\n\t\t\t\t$campo['manter'] = $col == 'seq'? false:true;\n\t\t\t\tif($col == \"unidseq\" || $col == \"usuaseq\"){\n\t\t\t\t\t$campo['statseq'] == 9;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($dataCol->type == 'date'){\n\t\t\t\t\t$campo['mascara'] = '\\'\\'99/99/9999\\'\\',1';\n\t\t\t\t\t$campo['seletor'] = \"CLASS_CALENDARIO\";\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"setSize\";\n\t\t\t\t\t$campoPropriedade['valor'] = \"80\";\n\t\t\t\t}else if(strpos($dataCol->type, 'varchar') !== false && $dataCol->length > 0){\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"maxlength\";\n\t\t\t\t\t$campoPropriedade['valor'] = $dataCol->length;\n\t\t\t\t}else if(strpos($dataCol->type, 'int') !== false && $col != 'statseq'){\n\t\t\t\t\t$campo['seletor'] = \"CLASS_MASCARA_NUMERICO\";\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"setSize\";\n\t\t\t\t\t$campoPropriedade['valor'] = \"60\";\n\t\t\t\t}else if(strpos($dataCol->type, 'bool') !== false){\n\t\t\t\t\t$campo['tpcaseq'] = \"3\";\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"addItems\";\n\t\t\t\t\t$campoPropriedade['valor'] = \"1=>Verdadeiro;0=>Falso\";\n\t\t\t\t}else if(strpos($dataCol->type, 'float') !== false){\n\t\t\t\t\t$campo['seletor'] = \"CLASS_MASCARA_VALOR\";\n\t\t\t\t}else if(strpos($dataCol->type, 'text') !== false){\n\t\t\t\t\t$campo['tpcaseq'] = \"9\";\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"setSize\";\n\t\t\t\t\t$campoPropriedade['valor'] = \"400;80\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($col == 'statseq'){\n\t\t\t\t\t$campo['tpcaseq'] = \"3\";\n\t\t\t\t\t$campoPropriedade = array();\n\t\t\t\t\t$campoPropriedade['metodo'] = \"addItems\";\n\t\t\t\t\t$campoPropriedade['valor'] = \"select seq,statdesc from \".$this->tableReferences['dbstatus'].\" where statseq = 1 order by seq\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($listFks[$col]){\n\t\t\t\t\t$searchListSeq = $this->createSearchList('campo_'.$col,$table,$listFks[$col]);\n\t\t\t\t\t$campo['ativapesquisa'] = $searchListSeq;\n\t\t\t\t}\n\n\t\t\t\t$retInsertCampo = $this->insertKrs('campos', $campo);\n\t\t\t\t\n\t\t\t\tif($campoPropriedade) {\n\t\t\t\t\t$campoPropriedade['campseq'] = $retInsertCampo['seq'];\n\n\t\t\t\t\t$this->insertKrs('campos_x_propriedades', $campoPropriedade);\n\t\t\t\t\t\n\t\t\t\t\tunset($campoPropriedade);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$campoBloco = array();\n\t\t\t\t$campoBloco['blocseq'] = $blocoSeq;\n\t\t\t\t$campoBloco['campseq'] = $retInsertCampo['seq'];\n\t\t\t\t$campoBloco['mostrarcampo'] = 'S';\n\t\t\t\t$campoBloco['ordem'] = $col == 'seq'? 1 : ++$count;\n\t\t\t\t\n\t\t\t\t$this->insertKrs('campos_x_blocos', $campoBloco);\n\t\t\t}\n\t\t\t\n\t\t\tunset($blocoSeq);\n\t\t}\n\t}",
"public function add_categoria_admin()\n\t{\n\t\tif(empty($_POST[\"nombre\"]) or empty($_FILES[\"cat_image\"][\"name\"]) )\n\t\t{\n\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=crear_categoria&msj=1\");\n\t\t\texit;\n\t\t}\n\t\t\n\t\t/*VERIFICAMOS QUE LA IMAGEN SEA JPG*/\n\t\tif($_FILES['cat_image']['type']=='image/jpeg')\n\t\t{\n\t\t\t/*verificamos primero que la categoria no este ya en la DB*/\n\t\t\t$sqlconsulta2 = \"select count(*) from categorias where nombre = ?\";\t\n\t\t\t$PDOsoporte2 = $this->conexionPDO->prepare($sqlconsulta2);\n\t\t\t$elnombre = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t$PDOsoporte2->bindValue(1,$elnombre,PDO::PARAM_STR);\n\t\t\t$PDOsoporte2->execute();\n\t\t\t\n\t\t\t/*si la categoria es nuevo en la DB entonces iniciamos la insercion del nvo registro*/\n\t\t\tif($PDOsoporte2->fetchColumn() == 0)\n\t\t\t{\n\t\t\t\t$lafoto = Configuracion::guerreras_magicas($_POST[\"nombre\"]) . \".jpg\";\t\n\t\t\t\t\n\t\t\t\t/*subimos la foto a la aplicacion*/\n\t\t\t\tcopy($_FILES[\"cat_image\"][\"tmp_name\"], \"public/images/categorias/\" . $lafoto);\n\t\t\t\t\t\n\t\t\t\tself::set_names_UTF8();\t\n\t\t\t\t$sqlconsulta = \"insert into categorias values (null, ?, ?)\";\n\t\t\t\t$PDOsoporte = $this->conexionPDO->prepare($sqlconsulta);\n\t\t\t\t\t\n\t\t\t\t/*filtramos con guerreras magicas() para evitar ataques xsl*/\n\t\t\t\t$elnombre = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t\t\t\n\t\t\t\t$PDOsoporte->bindValue(1,$elnombre,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte->bindValue(2,$lafoto,PDO::PARAM_STR);\n\n\t\t\t\t\t\n\t\t\t\tif($PDOsoporte->execute())\n\t\t\t\t{\n\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=crear_categoria&msj=3\");\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=crear_categoria&msj=2\");\t\t\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=crear_categoria&msj=4\");\n\t\t\t\texit;\t\t\t\n\t\t\t}\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=crear_categoria&msj=2\");\n\t\t\texit;\t\t\n\t\t}\n\t}",
"public function addCategoriaModel($datosModel,$tabla){\n //Se llama a la clase Conexion y al su método conectar que regresa un pdo y se prepara la instrucción INSERT \n $stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(nombre,descripcion,fecha_agregado) \n VALUES(:nombre,:descripcion,:fecha)\");\n \n //Se cambian los valores ocultos con los valores reales\n $stmt->bindParam(\":nombre\", $datosModel[\"nombre\"], PDO::PARAM_STR);\n $stmt->bindParam(\":descripcion\", $datosModel[\"descripcion\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":fecha\", $datosModel[\"fecha\"], PDO::PARAM_STR);\n \n //Se ejecuta la instrucción, si es exitosa lo hace saber, si no hace saber que no lo fue\n if($stmt->execute()){\n return \"success\";\n }\n else{\n return \"error\";\n }\n \n //Se cierra la conexión\n $stmt->close();\n }",
"public function agregar_categoria()\n {\n if (!$this->session->userdata('logged_in')) {\n redirect(base_url().'admin/login');\n }\n $data['page_title'] = \"Agregar categoria\";\n $data['error'] = null;\n\n if ($this->input->post()) {\n $this->form_validation->set_rules('categoria_nombre', 'Nombre', 'required');\n $this->form_validation->set_rules('categoria_descripcion', 'Descripcion', 'required');\n\n if ($this->form_validation->run() == false) {\n $data['error'] = \"Todos los campos son requeridos\";\n } else {\n $this->Categorias_Model->insert_categoria();\n $this->session->set_flashdata('mensaje', 'Categoria agregada correctamente');\n redirect(base_url() . 'admin');\n }\n }\n\n $this->load->view('admin/layouts/header', $data);\n $this->load->view('admin/modules/agregar_categoria', $data);\n $this->load->view('admin/layouts/footer');\n }",
"public function store(Request $request) //Request recibira datos desde un formulario y lo guardara en cada campo de la tabla categorias\n {\n if (!$request->ajax()){\n return redirect(\"/\");\n }else{\n\n $categoria = new Categoria();\n\n $categoria->nombre = $request->name;\n $categoria->descripcion = $request->desc;\n $categoria->condicion = '1';\n\n $categoria->save();\n }\n }",
"function crear($datos){\t\t\r\n\t\t//Se guardan sus datos en un array asociativo, el cual cada id o key tiene que tener el mismo nombre de la columna de la tabla en la bd. Sino se hace asi se genera error\r\n\t\t$array = array(\r\n\t\t\t'Nombre' => $datos[\"Nombre\"]);\r\n\r\n\t\t$this->db->insert('categoria', $array);//Se llama a la funcion de insertar datos y se le pasa el array asociativo\t\t\t\r\n\t\t\r\n\t}",
"public function create()\n\t{\n\t\tif (!$_POST) {\n\t\t\t$input = (object) $this->category->getDefaultValues(); // Variable 1\n\t\t} else {\n\t\t\t$input = (object) $this->input->post(null, true); // Variable 2\n\t\t}\n\n\t\t/**\n\t\t * Tanda negasi !\n\t\t * Setelah melakukan inputan pada field maka akan di cek validasinya sudah sesuai dengan required apa belum\n\t\t * jika gagal akan di kembalikan di page form categori, dengan inputan pada filed tidak hilang\n\t\t */\n\t\tif (!$this->category->validate()) {\n\t\t\t$data['title'] = 'Tambah Kategori';\n\t\t\t$data['input'] = $input;\n\t\t\t$data['form_action'] = base_url('category/create'); // form action untuk mengarahkan ke dalam page form tambah kategori\n\t\t\t$data['page'] = 'pages/category/form';\n\n\t\t\t$this->view($data);\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * if jika data berhasil divalidasi maka akan di insertkan ke database\n\t\t * dan di redirect ke page categori\n\t\t */\n\t\tif ($this->category->create($input)) {\n\t\t\t$this->session->set_flashdata('success', 'Data berhasil disimpan!');\n\t\t} else {\n\t\t\t$this->session->set_flashdata('error', 'Oops! Terjadi suatu kesalahan');\n\t\t}\n\n\t\tredirect(base_url('category'));\n\t}",
"private function _processInsert()\n\t{\n\t\t$data['file_names'] = array();\n\t\t\n\t\tif($this->input->post('submit'))\n\t\t{\n\t\t for($i=1;$i<=5;$i++)\n\t\t {\n if( $this->photos_model->storeForm(array(\"image_field\"=>\"image_{$i}\"),'') )\n {\n $data['file_names'][$i] = $this->photos_model->upload_data['file_name'];\n }\n\t\t }\n\t\t}\n\t\t\n\t\t$data['tpl_page'] = $this->_getController().'/add';\n\t\tparent::_OnOutput($data);\n\t}",
"public function categoria(){\n\t\t$this->set_config =\n\t \t\t[ \n\t\t\t'table' =>\n\t\t\t\t['nome' => 'tbl_categoria',\n\t\t\t\t 'chave_pk' => 'id_categoria',\n\t\t\t\t 'display' => 'Categoria'],\n\t\t\t'columns' =>\n\t\t\t\t[\n\t\t\t\t \n\t\t\t 'id_categoria' =>\n\t\t\t\t['display_column' => 'Id', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'number', 'required' => 'readonly'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => '',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'false'],\n\t\t\t 'nome' =>\n\t\t\t\t['display_column' => 'Categoria', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'situacao' =>\n\t\t\t\t['display_column' => 'Situação', \n\t\t\t\t \n\t\t\t\t 'select' => [\"a\" => \"Ativo\", \"d\" => \"Desativado\"],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'cssClass' =>\n\t\t\t\t['display_column' => 'Css', \n\t\t\t\t \n\t\t\t\t 'select' => [],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'controla_estoque' =>\n\t\t\t\t['display_column' => 'SN Controla Estoque', \n\t\t\t\t \n\t\t\t\t 'select' => [\"s\" => \"Sim\", \"n\" => \"Não\"],\n\t\t\t\t 'input' => ['type' => 'text', 'required' => 'required'],\n\t\t\t\t\t\n\t\t\t\t 'rules' => 'required',\n\t\t\t\t 'default_value' => '', \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'true'],\n\t\t\t 'id_usuario' =>\n\t\t\t\t['display_column' => '', \n\t\t\t\t \n\t\t\t\t 'select_relacional' => ['id_usuario','tbl_usuario', 'nome', []],\n\t\t\t\t\t\n\t\t\t\t 'rules' => '',\n\t\t\t\t 'default_value' => $this->session->userdata(\"id_user\"), \n\t\t\t\t 'costumer_value' => '',\n\t\t\t\t 'display_grid' => 'false'],\n\n\t\t\t\t],\n\t\t\t'where' => ['id_usuario' => $this->session->userdata('id_user')],\n\t\t\t'dropdown' => [],\n\t\t];\n\n\t\t$this->execute();\n\t}",
"public function form_insert($data){\n\t\t$this->db->insert('utilisateurs', $data);\n\t\t}",
"private function show_cont_insert_form(){\n\t\t$oMnu = new cMenu;\n\t\t$oMnu->set_id_sito($this->let_id_sito());\n\t\t$oMnu->set_user($this->let_id_sito(),$this->oUt);\n\t\t//Parte per l'inserimento del testo\n\t\t$form = new cForm();\n\t\t$form->formLabel(\"lImportante\",\"Le immagini e gli allegati si inseriscono una volta inserito il testo base.\",\"Immagini e allegati dovranno essere inseriti rieditando il contenuto che state per creare.\",\"style='color:red;'\");\n\t\t$form->formBr(2);\n\t\t$form->formOpenForm(\"Contenuto\",$_SERVER[\"SCRIPT_NAME\"] . \"?action=save&IdP=\".$_GET[\"IdP\"].\"\",\"post\",\"\",\"\");\n\t\t$form->formLabel(\"lSelectMenu\",\"Scegli il menu dove inserire il contenuto.\",\"Scegli il menu dove inserire il contenuto:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formSelect(\"\",\"PagPadre\",$oMnu->ShowList($_SERVER[\"SITO\"],1),10,\"\",\"+\");\n\t\t$form->formBr();\n\t\t//$form->formLabel(\"lSelectContenuto\",\"Scegli tipo contenuto.\",\"Scegli tipo contenuto:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formInput(\"hidden\",\"id\",\"\",70,\"\");\n\t\t$form->formLabel(\"lMenu\",\"Nome voce nel menu\",\"Nome voce menu:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formInput(\"text\",\"Menu\",\"\",70,\"\");\n\t\t$form->formBr();\n\t\t$form->formLabel(\"lTitolo\",\"Titolo contenuto\",\"Titolo contenuto:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formInput(\"text\",\"Titolo\",\"\",70,\"\");\n\t\t$form->formBr();\n\t\t$form->formLabel(\"lSottotitolo\",\"Sottotitolo contenuto\",\"Sottotitolo contenuto:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formTextarea(\"txtSottotitolo\",\"\",3,80,\"\");\n\t\t$form->formBr();\n\t\t$form->formLabel(\"lCorpo\",\"Corpo del test\",\"Corpo:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formTextarea(\"txtCorpo\",\"\",20,80,\"\");\n\t\t$form->formBr();\n\t\t$form->formLabel(\"lFirma\",\"Firma dell'autore'\",\"Firma:\",\"\");\n\t\t$form->formBr();\n\t\t$form->formInput(\"text\",\"Firma\",\"\",35,\"\");\n\t\t$form->formBr(2);\n\t\t$form->formInput(\"submit\",\"cmdModify\",\"Crea\",\"\",\"\");\n\t\t$form->formBr();\n\t\t$form->formCloseForm();\t\n \t}",
"public function inserta_asig_cat($datos){\n $this->db->set('id_categoria', $datos['id_cat']);\n $this->db->set('id_producto', $datos['id_prod']);\n $this->db->insert('asigna_categoria');\n if($this->db->affected_rows() > 0)\n {\n redirect('administrador/AsignaCats/'.$datos['id_prod'],'refresh');\n }\n }"
] | [
"0.72287637",
"0.7121635",
"0.677548",
"0.6701691",
"0.6695616",
"0.6690407",
"0.6644472",
"0.6590444",
"0.65776265",
"0.6549251",
"0.65099025",
"0.6439623",
"0.64367354",
"0.6417961",
"0.64132446",
"0.6392575",
"0.63861465",
"0.6350417",
"0.6340103",
"0.6319349",
"0.6319116",
"0.6314515",
"0.62908703",
"0.6282485",
"0.6266146",
"0.6250811",
"0.6242039",
"0.62341684",
"0.62326175",
"0.6221323"
] | 0.7257495 | 0 |
Metoda que carrega el formulari de update per categoria | public function formUpdate() {
if (!isset($_GET['id'])) {
return call('pages', 'error');
}
// utilizamos el id para obtener el post correspondiente
$cat = Categoria::find($_GET['id']);
require_once('views/categoria/formUpdate.php');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function Editar() {\n $Update = new Update;\n $Update->ExeUpdate(self::Tabela, $this->dados, \"WHERE categoria_id = :catid\", \"catid={$this->categoriaId}\");\n\n //Se o if retornar é porque atualizou corretamente a categoria\n if ($Update->getResult()):\n $tipo = (empty($this->dados['categoria_pai']) ? 'seção' : 'categoria');\n $this->error = [\"<b>Sucesso:</b> {$tipo} <b>{$this->dados['categoria_titulo']}</b> foi atualizada com sucesso no sistema\", ZT_ACCEPT];\n $this->result = true;\n endif;\n }",
"public function update() {\n if (!isset($_POST['nom'])){\n return call('pages', 'error');\n }\n\n Categoria::modificar($_GET['id'], $_POST['nom'], $_POST['sub_categoria']);\n \n $cats = Categoria::all();\n \n require_once('views/categoria/index.php');\n }",
"function editar_categoria(){\n\t\t$this->accion=\"Editando Datos de Categoría\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT * FROM categoria WHERE nombre_cat='$this->nombre' AND id_cat!='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\tif($resultado=mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=1;\n\t\t\t}else{\n\t\t\t\t$sql=\"UPDATE categoria SET nombre_cat='$this->nombre', etiqueta_cat='$this->etiqueta', prioridad_cat='$this->prioridad', padre_cat='$this->padre' WHERE id_cat='$id'\";\n\t\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\theader(\"location:/admin/categoria/\");\n\t\t\t}\n\t\t}else{\n\t\t $this->mostrar_categoria();\n\t\t}\n\t}",
"function c_update() {\n $this->Crud_model->m_update();\n $this->c_select();\n }",
"public function testUpdateMetaform()\n {\n }",
"function UpdateCat(){\n\n $idc = $_POST['editarID'];\n $nombre1 = $_POST['editarCategoria'.$idc.''];\n $estatus1 = $_POST['editarEstatus'.$idc.''];\n \n\n\n\n if( !empty($nombre1) ){\n $nombre1 = htmlspecialchars($nombre1);\n //filter_var($nombreCat, 'FILTER_SANITIZE_STRING');\n }else{\n $msj .=\"<li>La categoria no puede estar vacia</li>\";\n }\n if( !empty($estatus1) ){\n $estatus1 = htmlspecialchars($estatus1);\n //filter_var($estatus, 'FILTER_SANITIZE_STRING');\n }else{\n $msj .=\"<li>El estatus no puede estar vacia</li>\";\n }\n\n include('../config/db.php');\n\n $statement = $conexion->prepare(\"update Categorias set categoria = ('$nombre1') , StatusCategory = ($estatus1) where ID_Categoria = $idc\");\n $statement->execute();\n\n echo ' <script> window.location = \"?ruta=categorias\"; </script>';\n}",
"public function update($tblForm2550m);",
"public function edit_categoria_admin()\n\t{\n\t\tif(empty($_POST[\"nombre\"]))\n\t\t{\n\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=1\");\n\t\t\texit;\n\t\t}\n\t\t\n\t\tself::set_names_UTF8();\n\t\t\t\n\t\t/*verificamos primero que la id que nos llega por GET si esta en la DB y no es trampa por GET*/\n\t\t$sqlconsultaM = \"select count(*) from categorias where usuario_id = ?\";\n\t\t$PDOsoporteM = $this->conexionPDO->prepare($sqlconsultaM);\n\t\t$elidusuario = Configuracion::guerreras_magicas($_POST[\"usuario_id\"]);\n \n $PDOsoporteM->bindValue(1,$elidusuario,PDO::PARAM_INT);\t\t\n\t\t\n\t\t$PDOsoporteM->execute();\n\t\t\t\n\t\t/*si no se encuentra ningun resultado, entonces el dato que nos viene por POST es malicioso.. */\n\t\tif($PDOsoporteM->fetchColumn() == 0)\n\t\t{\n\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=error\");\n\t\t\texit;\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\t/* si el usuario no actualiza la foto... */\n\t\tif(empty($_FILES[\"cat_image\"][\"name\"]))\n\t\t{\n\t\t\t/*\n\t\t\tverificamos primero que el nombre de la categoria no este ya en la DB\n\t\t\tA MENOS QUE.. sea el mismo que ya tenia antes, \n\t\t\ten cuyo caso el sistema debe permitir conservarlo, actualizando solo el otro valor\n\t\t\t*/\n\t\t\t\n\t\t\t$sqlconsulta2 = \"select count(*) from categorias where nombre = ? and ? != ?\";\t\n\t\t\t$PDOsoporte2 = $this->conexionPDO->prepare($sqlconsulta2);\n\t\t\t$elnombre2 = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t$elnombre3 = Configuracion::guerreras_magicas($_POST[\"antiguo_nombre\"]);\n\t\t\t$PDOsoporte2->bindValue(1,$elnombre2,PDO::PARAM_STR);\n\t\t\t$PDOsoporte2->bindValue(2,$elnombre2,PDO::PARAM_STR);\n\t\t\t$PDOsoporte2->bindValue(3,$elnombre3,PDO::PARAM_STR);\n\t\t\t$PDOsoporte2->execute();\n\t\t\t\n\t\t\t/*si el nombre de la categoria es nuevo en la DB entonces iniciamos la actualizacion del nvo registro*/\n\t\t\tif($PDOsoporte2->fetchColumn() == 0)\n\t\t\t{\n\t\t\t\t/* ...dejamos la que estaba antes y actualizamos los demas datos */\n\t\t\t\t$lafoto=$_POST[\"antigua_foto\"];\t\n\t\t\t\t\n\t\t\t\tself::set_names_UTF8();\t\n\t\t\t\t$sqlconsulta = \"\n\t\t\t\t\n\t\t\t\tupdate categorias set \n\t\t\t\tnombre = ?,\n\t\t\t\tcategoria_imagen = ?\n\t\t\t\twhere categoria_id = ?\n\t\t\t\t\n\t\t\t\t\";\t\n\t\t\t\t\n\t\t\t\t$PDOsoporte = $this->conexionPDO->prepare($sqlconsulta);\n\t\t\t\t\n\t\t\t\t/*filtramos con guerreras magicas() para evitar ataques xsl*/\n\t\t\t\t$elnombre = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t\t$lacategoriaid = Configuracion::guerreras_magicas($_POST[\"categoria_id\"]);\n\t\t\t\t\n\t\t\t\t$PDOsoporte->bindValue(1,$elnombre,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte->bindValue(2,$lafoto,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte->bindValue(3,$lacategoriaid,PDO::PARAM_INT);\n\t\t\t\t\n\t\t\t\tif($PDOsoporte->execute())\n\t\t\t\t{\n\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=3&categoria_id=\" . $_POST[\"categoria_id\"]);\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=2&categoria_id=\" . $_POST[\"categoria_id\"]);\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->conexionPDO=null;\n\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=4&categoria_id=\" . $_POST[\"categoria_id\"]);\t\n\t\t\t}\t\t\t\n\t\t\t\n\t\t}\n\t\t/*si se actualiza la foto entonces la actualiza en la DB*/\n\t\telse\n\t\t{\n\t\t\t/*verificamos que la imagen sea formato jpg*/\n\t\t\tif($_FILES['cat_image']['type']=='image/jpeg')\n\t\t\t{\t\n\t\t\n\t\t\t\t/*\n\t\t\t\tverificamos primero que el nombre de la categoria no este ya en la DB\n\t\t\t\tA MENOS QUE.. sea el mismo que ya tenia antes, \n\t\t\t\ten cuyo caso el sistema debe permitir conservarlo, actualizando solo el otro valor\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t$sqlconsulta2 = \"select count(*) from categorias where nombre = ? and ? != ?\";\t\n\t\t\t\t$PDOsoporte2 = $this->conexionPDO->prepare($sqlconsulta2);\n\t\t\t\t$elnombre2 = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t\t$elnombre3 = Configuracion::guerreras_magicas($_POST[\"antiguo_nombre\"]);\n\t\t\t\t$PDOsoporte2->bindValue(1,$elnombre2,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte2->bindValue(2,$elnombre2,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte2->bindValue(3,$elnombre3,PDO::PARAM_STR);\n\t\t\t\t$PDOsoporte2->execute();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*si el email es nuevo en la DB entonces iniciamos la actualizacion del nvo registro*/\n\t\t\t\tif($PDOsoporte2->fetchColumn() == 0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/*eliminamos la vieja foto de la aplicacion*/\n\t\t\t\t\t$vieja_foto = Configuracion::guerreras_magicas($_POST[\"antigua_foto\"]);\t\t\t\n\t\t\t\t\tunlink('public/images/categorias/' . $vieja_foto);\n\n\t\t\t\t\t/*preparamos el nombre que va a tener la foto*/\n\t\t\t\t\t$lafoto = Configuracion::guerreras_magicas($_POST[\"nombre\"]) . \".jpg\";\t\n\t\t\t\t\t\n\t\t\t\t\t/*subimos la foto a la aplicacion*/\n\t\t\t\t\tcopy($_FILES[\"cat_image\"][\"tmp_name\"], \"public/images/categorias/\" . $lafoto);\n\t\t\t\t\t\n\t\t\t\t\tself::set_names_UTF8();\t\n\t\t\t\t\t\n\t\t\t\t\t$sqlconsulta = \"\n\t\t\t\t\t\n\t\t\t\t\tupdate categorias set \n\t\t\t\t\tnombre = ?,\n\t\t\t\t\tcategoria_imagen = ?\n\t\t\t\t\twhere categoria_id = ?\n\t\t\t\t\t\n\t\t\t\t\t\";\n\t\t\t\t\t\n\t\t\t\t\t$PDOsoporte = $this->conexionPDO->prepare($sqlconsulta);\n\t\t\t\t\t\n\t\t\t\t\t/*filtramos con guerreras magicas() para evitar ataques xsl*/\n\t\t\t\t\t$elnombre = Configuracion::guerreras_magicas($_POST[\"nombre\"]);\n\t\t\t\t\t$lacategoriaid = Configuracion::guerreras_magicas($_POST[\"categoria_id\"]);\n\t\t\t\t\t\n\t\t\t\t\t$PDOsoporte->bindValue(1,$elnombre,PDO::PARAM_STR);\n\t\t\t\t\t$PDOsoporte->bindValue(2,$lafoto,PDO::PARAM_STR);\n\t\t\t\t\t$PDOsoporte->bindValue(3,$lacategoriaid,PDO::PARAM_INT);\n\t\t\t\t\t\n\t\t\t\t\tif($PDOsoporte->execute())\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=3&categoria_id=\" . $_POST[\"categoria_id\"]);\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=2&categoria_id=\" . $_POST[\"categoria_id\"]);\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->conexionPDO=null;\n\t\t\t\t\t/*echo \"EMAIL SI ENCONTRADO\"; exit;*/\n\t\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=4&categoria_id=\" . $_POST[\"categoria_id\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader(\"Location: \" . Configuracion::ruta() . \"?controlador=editar_categoria&msj=2&categoria_id=\" . $_POST[\"categoria_id\"]);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}",
"protected function edit_category( )\n {\n if(!empty($this->name_entity)) {\n \n $object = array(':id' => $this->id_entity, \n ':valor' => $this->name_entity); \n \n if($this->model->update($object)) \n array_push($this->messages, array('info', 'Categoría editada correctamente!'));\n else \n array_push($this->messages, array('error', 'Error al editar la categoría'));\n }\n \n $this->list_category();\n }",
"public function updateCategory()\n\t{\n\t}",
"public function updateEntityData()\n\t{\n\t\t$this->form_validation->set_rules('uCategoryName', 'Category Name', 'required');\n\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\techo json_encode(['status'=>false, 'message'=>validation_errors()]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$updateData=[\n\t\t\t\t'CategoryName'=>$this->input->get_post('uCategoryName'),\n\t\t\t];\n\t\t\t//die($this->upload->display_errors());\n\t\t\t$table = $this->__TABLE;\n\t\t\t$where = [\n\t\t\t\t$this->__ID => $this->input->post(\"u\".$this->__ID)\n\t\t\t];\n\t\t\t$this->model->update_entity($table, $updateData, $where);\n\t\t\techo json_encode(['status'=>true, 'message'=>'Record Successfully Updated']);\n\t\t}\n\t}",
"function ot_update_categories()\n{\n // loop through $_POST and for each field_X_order values, update the $curr\n while (list($key, $val) = each($_POST))\n {\n // find the field id\n preg_match(\"/^category_(\\d+)_order$/\", $key, $match);\n\n if (!empty($match[1]))\n {\n $category_id = $match[1];\n $category_name = $_POST[\"category_{$category_id}_name\"];\n $export_only = isset($_POST[\"export_only_{$category_id}\"]) ? \"yes\" : \"no\";\n\n mysql_query(\"\n UPDATE tr_project_categories\n SET category_name = '$category_name',\n export_only = '$export_only'\n WHERE category_id = $category_id\n \") or die(mysql_error());\n }\n }\n}",
"public function edit_category ()\n\t{\n\t\tupdate_option(self::option_string($_POST['name']), isset($_POST['is_secure']));\n\t}",
"function update ()\n {\n $nodeTypeCategory = Doctrine_Core::getTable ( 'NodeTypeCategory' )->find ( $this->input->post ( 'node_type_category_id' ) );\n $nodeTypeCategory[ 'node_type_category_name' ] = $this->input->post ( 'node_type_category_name' );\n $nodeTypeCategory->save ();\n echo '{\"success\": true}';\n }",
"private function _createUpdateCategories() {\n $cat_by_ids = (array) $this->_getOptionValuesById();\n $cat_by_name = (array) $this->_getOptionValuesByName();\n $cat_names = array_merge($cat_by_name,$cat_by_ids);\n $filtered_cats = $this->_filterCats($cat_names);\n if(isset($filtered_cats['new'])) {\n $this->_addCategory($filtered_cats['new']);\n }\n if(isset($filtered_cats['old'])) {\n $this->_updateCategory($filtered_cats['old']);\n }\n }",
"protected function _modify_category_data_fields()\n\t{\n\t\t// Get all fields\n\n\t\t$cat_fields = ee()->db->get('category_fields');\n\n\t\tforeach ($cat_fields->result_array() as $field)\n\t\t{\n\t\t\t$field_name = 'field_id_'.$field['field_id'];\n\n\t\t\tee()->smartforge->modify_column(\n\t\t\t\t'category_field_data',\n\t\t\t\tarray(\n\t\t\t\t\t$field_name => array(\n\t\t\t\t\t\t'name' \t\t\t=> $field_name,\n\t\t\t\t\t\t'type' \t\t\t=> 'text',\n\t\t\t\t\t\t'null' \t\t\t=> TRUE\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $id = Yii::$app->request->get('id');\n $qqq = new UploadForm(); \n\n $product = Product::find()->where(['id' => $id])->with(['category.inCategory.catOption' => function(ActiveQuery $query){\n $query->where(['product_id' => Yii::$app->request->get('id')]);\n }])->one();\n \n \n $catid = $product->category->inCategory;\n $value = Yii::$app->request->post('value'); \n $createvalue = Yii::$app->request->post('createvalue');\n if ($createvalue){\n foreach($createvalue as $key => $val){\n if (!empty($val)){\n $qwe = new CatOption();\n $qwe->incat_id = $key;\n $qwe->product_id = Yii::$app->request->get('id');\n $qwe->value = $val;\n $qwe->save();\n }\n }\n }\n if (!empty($value)){\n foreach($value as $key => $val){\n $cat = CatOption::find()->where(['id' => $key])->one();\n $cat->value = $val;\n $cat->save();\n }\n }\n if ($model->load(Yii::$app->request->post())) {\n $model->group = Yii::$app->request->post('Product')['group'];\n $model->key = 1000 + $model->id;\n $model->save();\n if (Yii::$app->request->isPost){\n $qqq->imageFiles = UploadedFile::getInstances($qqq, 'imageFiles');\n if($qqq->imageFiles){\n print_r(Yii::$app->request);\n\n if ($qqq->upload()) {\n foreach ($_FILES['UploadForm']['name']['imageFiles'] as $file) {\n $qwe = new Image();\n $qwe->product_id = $model->id;\n $qwe->name = 'upload/'.$file;\n $qwe->save();\n }\n }\n }\n }\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'catid' => $catid,\n 'catl' => $catl,\n 'qqq' => $qqq,\n ]);\n }\n }",
"function EDIT()\n{\n\t// se construye la sentencia de busqueda de la tupla en la bd\n $sql = \"SELECT * FROM CATEGORIA WHERE idCategoria = '\".$this->idCategoria.\"'\";\n // se ejecuta la query\n $result = $this->mysqli->query($sql);\n // si el numero de filas es igual a uno es que lo encuentra\n if ($result->num_rows == 1)\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t$sql = \"UPDATE CATEGORIA SET \n\t\t\t\t\tidCategoria = '$this->idCategoria',\n\t\t\t\t\tgenero = '$this->genero',\n\t\t\t\t\tnivel = '$this->nivel',\n\t\t\t\t\tidCampeonato = '$this->idCampeonato'\t\t\t\t\t\n\t\t\t\tWHERE ( idCategoria = '$this->idCategoria'\n\t\t\t\t)\";\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n if (!($resultado = $this->mysqli->query($sql))){\n\t\t\treturn 'Error en la modificación'; \n\t\t}\n\t\telse{ \n\t\t\treturn 'Modificado correctamente.';\n\t\t\t\n\t\t}\n }\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n \treturn 'No existe en la base de datos';\n}",
"public function modificatipologiapageAction(){\n \n $id = $this->_getParam('idtipologia');\n $urlHelper = $this->_helper->getHelper('url');\n $this->_modificaTipologiaForm->setAction($urlHelper->url(array(\n\t\t\t\t'controller' => 'admin',\n\t\t\t\t'action' => 'modificatipologia',\n 'id'=>$id),\n\t\t\t\t'default'\n\t\t\t\t));\n $tipologia = $this->_AdminModel->getTipologiaById($id);\n $tipologia = $tipologia->toArray();\n \n $this->_modificaTipologiaForm->populate($tipologia);\n \n }",
"public function updateCategoria(){\n try{\n if($this->input->post('submit')){\n $categoria = array();\n $categoria['id'] = $this->input->post('id_cat');\n $categoria['nombre'] = $this->input->post('categoria');\n $categoria['nombre_en'] = $this->input->post('categoria_en');\n $categoria['nombre_de'] = $this->input->post('categoria_de');\n $this->categorias->updateCategoria($categoria);\n $this->session->set_flashdata('update_ok','Categoría actualizada correctamente.');\n $this->load->view('categorias/listar');\n redirect('categorias/listar', 'refresh');\n }\n } catch (Exception $e){\n show_error('Se ha producido un error con la base de datos, disculpe las molestias');\n }\n }",
"public function actionUpdate($id){\n $cities_check = Cities::find()->orderBy('id asc')\n ->where(['status'=>1,'id'=>$id])->one();\n if(!empty($cities_check)){\n $specialities = MetaValues::find()->orderBy('id asc')\n ->where(['key'=>5])->all();\n\n $treatments = MetaValues::find()->orderBy('id asc')\n ->where(['key'=>9])->all();\n\n $hospital_data = DrsPanel::getallhospital();\n\n $model =new PopularCityDataForm();\n $popularMetaHospital = PopularMeta::find()->where(['key' => 'hospital','city_id'=>$id])->all();\n $popularMetaSpeciality = PopularMeta::find()->where(['key' => 'speciality','city_id'=>$id])->all();\n $popularMetaTreatment = PopularMeta::find()->where(['key' => 'treatment','city_id'=>$id])->all();\n\n\n if (Yii::$app->request->post()) {\n $post = Yii::$app->request->post();\n $postData = $post['PopularCityDataForm'];\n\n $city_id=$postData['city'];\n $city_name=DrsPanel::getCityName($city_id);\n\n if(isset($postData['hospital'])) {\n $hospital_model = PopularMeta::find()->where(['key' => 'hospital','city_id'=>$city_id])->one();\n if(!empty($hospital_model)) {\n $hospital_model->delete();\n }\n if(!empty($postData['hospital'])){\n $hospital_model = new PopularMeta();\n $hospital = implode(',', $postData['hospital']);\n $hospital_model->city_id=$city_id;\n $hospital_model->city=$city_name;\n $hospital_model->value = $hospital;\n $hospital_model->key = 'hospital';\n $hospital_model->save();\n }\n\n }\n if(isset($postData['speciality'])) {\n $speciality_model = PopularMeta::find()->where(['key' => 'speciality','city_id'=>$city_id])->one();\n if(!empty($speciality_model))\n {\n $speciality_model->delete();\n }\n if(!empty($postData['speciality'])){\n $speciality_model = new PopularMeta();\n $speciality = implode(',', $postData['speciality']);\n $speciality_model->city_id=$city_id;\n $speciality_model->city=$city_name;\n $speciality_model->value = $speciality;\n $speciality_model->key = 'speciality';\n $speciality_model->save();\n }\n }\n if(isset($postData['treatment'])) {\n $treatment_model = PopularMeta::find()->where(['key' => 'treatment','city_id'=>$city_id])->one();\n if(!empty($treatment_model))\n {\n $treatment_model->delete();\n }\n if(!empty($postData['treatment']))\n {\n $treatment_model = new PopularMeta();\n $treatment = implode(',', $postData['treatment']);\n $treatment_model->city_id=$city_id;\n $treatment_model->city=$city_name;\n $treatment_model->value = $treatment;\n $treatment_model->key = 'treatment';\n $treatment_model->save();\n }\n }\n\n Yii::$app->session->setFlash('alert', [\n 'options'=>['class'=>'alert-success'],\n 'body'=>Yii::t('backend', 'Data updated!')\n ]);\n return $this->redirect(Yii::$app->request->referrer);\n\n }\n\n return $this->render('update', [\n 'model' => $model,'specialities' => $specialities, 'treatments' => $treatments ,'cities'=>$cities_check,'hospitalData' => $hospital_data,'popularHospital' => $popularMetaHospital,'popularSpeciality' => $popularMetaSpeciality, 'popularTreatment' => $popularMetaTreatment\n ]);\n }\n else{\n Yii::$app->session->setFlash('alert', [\n 'options'=>['class'=>'alert-error'],\n 'body'=>Yii::t('backend', 'Error!')\n ]);\n return $this->redirect(['index']);\n }\n }",
"public function actionUpdate()\n\t{\n\t\tif( isset( $_POST['AvisEntreprise'] ) )\n\t\t{\n\t\t\t/*\t\tOn récupère l'entrée avec l'identifiant \t\t*/\n\t\t\t$model=$this->loadModel( intval( $_POST['AvisEntreprise']['id_avis_entreprise'] ) );\n\t\t\t/*\t\tSomme pour calculer la note moyenne\t\t*/\n\t\t\t$somme_double = 0;\n\t\t\t$nb_elements_int = 0;\n\t\t\t/*\t\tVariable utilisée pour regarder s'il y a des erreurs lors de l'insértion \t\t*/\n\t\t\t$erreurCounter_int = 0;\n\n\t\t\t/*\t\tOn boucle sur chaque critère de notation \t\t*/\n\t\t\tforeach ( $_POST as $key_str => $value_str ) \n\t\t\t{\n\t\t\t\t/*\t\tOn cherche que les paramètres POST qui sont notés ou avec un commentaire \t\t*/\n\t\t\t\tif( strpos( $key_str, \"_text\" ) )\n\t\t\t\t{\n\t\t\t\t\t$id_critere = intval( str_replace( '_text', '', $key_str ) );\n\t\t\t\t\t//var_dump( $id_critere );\n\t\t\t\t\t$critereModel_obj = EntrepriseAvisCritere::model()->findByAttributes( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id_critere_notation_entreprise\" => $id_critere,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id_avis_entreprise\" => $model->id_avis_entreprise \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$critereModel_obj->commentaire_evaluation_critere = trim( $value_str );\n\n\t\t\t\t\t$succes_bool_1 = $critereModel_obj->save();\n\t\t\t\t\tif( !$succes_bool_1 )\n\t\t\t\t\t\t$erreurCounter_int++;\n\n\t\t\t\t}\n\t\t\t\t/*\t\tLes paramètres qui sont notés \t\t*/\n\t\t\t\telse if ( strpos( $key_str, \"_note\" ) )\n\t\t\t\t{\n\t\t\t\t\t$id_critere = intval( str_replace( '_note', '', $key_str ) );\n\t\t\t\t\t$critereModel_obj = EntrepriseAvisCritere::model()->findByAttributes( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id_critere_notation_entreprise\" => $id_critere,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id_avis_entreprise\" => $model->id_avis_entreprise \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$critereModel_obj->note_entreprise_avis = trim( $value_str );\n\n\t\t\t\t\t$succes_bool_2 = $critereModel_obj->save();\n\n\t\t\t\t\tif ( $succes_bool_2 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$somme_double += $value_str;\n\t\t\t\t\t\t$nb_elements_int++;\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$erreurCounter_int++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\n\t\t\t}\n\n\t\t\t$model->note_generale_avis_entreprise = $somme_double / $nb_elements_int;\n\t\t\t$resultBool_bool = $model->save();\n\n\t\t\tvar_dump( $model );\n\t\t\t\n\t\t\tif ( $resultBool_bool && $erreurCounter_int == 0 ) \n\t\t\t{\n\t\t\t\t/*\t\tOn redirige vers l'employé concerné \t\t*/\n\t\t\t\t$url = $this->createUrl( 'entreprise/view', array( \t'id' => $model->id_entreprise ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'error' => $erreurCounter_int ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'update' => 'true' ) );\n\t\t\t\t$this->redirect( $url );\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$erreurCounter_int++;\n\t\t\t\t$url = $this->createUrl( 'entreprise/view', array( \t'id' => $model->id_entreprise ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'error' => $erreurCounter_int ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'update' => 'true' ) );\n\t\t\t\t$this->redirect( $url );\n\t\t\t}\n\t\t}\n\t}",
"public function actionUpdate($id)\n\t{\n\t\t$item=$this->loadModel($id);\n $item_has_categoria = new ItemHasCategoria;\n $item_has_autor = new ItemHasAutor;\n $item_has_tipoformato = new ItemHasTipoformato;\n $item_has_terceros = new ItemHasTerceros;\n $itemhastipoatributos = new ItemHasTipoitematributos;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Item']))\n\t\t{\n\t\t\t$item->attributes=$_POST['Item'];\n\t\t\tif($item->save()){\n //Actualizar categorias\n $item_has_categoria->deleteAllByAttributes(array('item_iditem'=>$item->iditem));\n if(isset($_POST['item_has_categoria'])){\n if(is_array($_POST['item_has_categoria'] )){\n foreach($_POST['item_has_categoria'] as $idcategoria){\n $itemhascategoria = new ItemHasCategoria;\n $itemhascategoria->item_iditem = $item->iditem;\n $itemhascategoria->categoria_idcategoria = $idcategoria;\n if (!$itemhascategoria->save()){\n print_r($itemhascategoria->errors);\n yii::app()->end();\n }\n \n }\n }\n \n }\n \n //Actualizar autores\n $item_has_autor->deleteAllByAttributes(array('item_iditem'=>$item->iditem));\n if(isset($_POST['item_has_autor'])){\n if(is_array($_POST['item_has_autor'] )){\n foreach($_POST['item_has_autor'] as $idautor){\n $itemhasautor = new ItemHasAutor;\n $itemhasautor->item_iditem = $item->iditem;\n $itemhasautor->autor_idautor = $idautor;\n if (!$itemhasautor->save()){\n print_r($itemhasautor->errors);\n yii::app()->end();\n }\n \n }\n }\n \n }\n \n //Actualizar formatos\n $item_has_tipoformato->deleteAllByAttributes(array('item_iditem'=>$item->iditem));\n if(isset($_POST['item_has_tipoformato'])){\n if(is_array($_POST['item_has_tipoformato'] )){\n foreach($_POST['item_has_tipoformato'] as $idtipoformato){\n $itemhastipoformato = new ItemHasTipoformato;\n $itemhastipoformato->item_iditem = $item->iditem;\n $itemhastipoformato->tipoformato_idtipoformato = $idtipoformato;\n if (!$itemhastipoformato->save()){\n print_r($itemhastipoformato->errors);\n yii::app()->end();\n }\n \n }\n }\n \n }\n \n //Actualizar proveedor\n $item_has_terceros->deleteAllByAttributes(array('item_iditem'=>$item->iditem));\n $item_has_terceros->attributes = $_POST['ItemHasTerceros'];\n $item_has_terceros->item_iditem = $item->iditem;\n if (!$item_has_terceros->save()){\n print_r($item_has_terceros->errors);\n yii::app()->end();\n }\n \n //Relacion con tipositematributos\n $itemhastipoatributos->deleteAllByAttributes(array('item_iditem'=>$item->iditem));\n unset($itemhastipoatributos);\n if(isset($_POST['item_has_tipoitematributos'])){\n if(is_array($_POST['item_has_tipoitematributos'] )){\n foreach($_POST['item_has_tipoitematributos'] as $atributo){\n $itemhastipoatributos = new ItemHasTipoitematributos;\n $itemhastipoatributos->item_iditem = $item->iditem;\n $itemhastipoatributos->tipoitematributos_idtipoitematributos = $atributo[\"idtipoitematributo\"];\n switch($atributo['idtipoitematributo']){\n case '1':{ //GUARDAR IMAGEN\n \n ////GUARDAR ADJUNTO\n $files_uploades = CUploadedFile::getInstancesByName('valor'.$atributo['idtipoitematributo']);\n \n if(!is_dir(\"uploadedfiles/productos/\".$item->iditem)){\n if(!mkdir(\"uploadedfiles/productos/\".$item->iditem)){\n die(\"No pudo crearse la carpeta de archivos \" .\"uploadedfiles/productos/\".$item->iditem);\n }\n }\n \n \n \n unset($itemhastipoatributos);\n \n foreach ($files_uploades as $image => $pic) {\n if($pic->name=='')continue;\n $itemhastipoatributos = new ItemHasTipoitematributos;\n $itemhastipoatributos->item_iditem = $item->iditem;\n $itemhastipoatributos->tipoitematributos_idtipoitematributos = $atributo[\"idtipoitematributo\"];\n \n $itemhastipoatributos->valor = \"uploadedfiles/productos/\".$item->iditem.\"/\".$pic->name;\n \n $pic->saveAs(\"uploadedfiles/productos/\".$item->iditem.\"/\".$pic->name);\n \n \n if (!$itemhastipoatributos ->save()){\n print_r($itemhastipoatributos->errors);\n yii::app()->end();\n }\n unset($itemhastipoatributos);\n }\n \n \n break;\n }\n default:{ //guardat texto\n if($atributo['valor']=='')continue;\n $itemhastipoatributos->valor = $atributo['valor'];\n if (!$itemhastipoatributos ->save()){\n print_r($itemhastipoatributos->errors);\n yii::app()->end();\n }\n }\n }\n \n \n \n }\n }\n \n }\n \n \n \n $this->redirect(array('view','id'=>$item->iditem));\n \n \n }\n\t\t\t\t\n\t\t}\n \n //Get listado de categorias\n $sql = \"select ic.categoria_idcategoria from item_has_categoria as ic \n where ic.item_iditem='\".$id.\"'\" ; \n $categorias = Yii::app()->db->createCommand($sql)->queryAll();\n if(is_array($categorias)){\n $cat=array();\n foreach($categorias as $row){\n $cat[]=$row['categoria_idcategoria'];\n }\n }else{\n $row=null;\n }\n \n \n \n //Get listado de autores\n $sql = \"select ia.autor_idautor from item_has_autor as ia \n where ia.item_iditem='\".$id.\"'\" ; \n $autores = Yii::app()->db->createCommand($sql)->queryAll();\n if(is_array($autores)){\n $aut=array();\n foreach($autores as $row){\n $aut[]=$row['autor_idautor'];\n }\n }else{\n $row=null;\n }\n \n \n //Get listado de formatos\n $sql = \"select itf.tipoformato_idtipoformato from item_has_tipoformato as itf \n where itf.item_iditem='\".$id.\"'\" ; \n $formatos = Yii::app()->db->createCommand($sql)->queryAll();\n if(is_array($formatos)){\n $form=array();\n foreach($formatos as $row){\n $form[]=$row['tipoformato_idtipoformato'];\n }\n }else{\n $row=null;\n }\n \n $item_has_terceros = ItemHasTerceros::model()->findByAttributes(array('item_iditem'=>$id));\n if(!$item_has_terceros){\n $item_has_terceros = new ItemHasTerceros;\n }\n \n $item_has_tipoitematributos = ItemHasTipoitematributos::model()->findAllByAttributes(array('item_iditem'=>$id));\n if(!$item_has_tipoitematributos){\n $item_has_tipoitematributos = new ItemHasTipoitematributos;\n }\n \n\t\t$this->render('update',array(\n\t\t\t'item'=>$item,\n 'item_has_categoria'=>$cat,\n 'item_has_autor'=>$aut,\n 'item_has_tipoformato'=>$form,\n 'item_has_terceros'=>$item_has_terceros,\n 'tipoitematributos'=> Tipoitematributos::model()->findAll(),\n 'item_has_tipoitematributos'=>$item_has_tipoitematributos,\n\t\t));\n \n\t}",
"public function update(Request $request, User_info_field $field)\n {\n $request->validate([\n 'name' => 'required',\n 'shortname' => 'required',\n ]);\n \n if($field->category_id == $request->input('category_id')){\n $field->update($request->all());\n }\n else{\n //restauración de la categoria anterior\n $aorder = User_info_field::all()->where('category_id',$field->category_id)->count();\n $alorders = User_info_field::all()->where('category_id',$field->category_id);\n foreach ($alorders as $alorder) {\n if ($field->sortorder < $alorder->sortorder ) {\n $campo = User_info_field::find($alorder->id);\n $campo->sortorder = $alorder->sortorder-1;\n $campo->save();\n }\n }\n //traslado de la categoria + ordenamiento\n $setorder = User_info_field::all()->where('category_id',$request->input('category_id'))->count()+1;\n $field->update($request->only(\n 'shortname',\n 'name',\n 'dataype',\n 'description',\n 'descriptionformat',\n 'category_id',\n 'require',\n 'locked',\n 'visible',\n 'forceunique',\n 'signup',\n 'defaultdata',\n 'name',\n 'defaultdataformat',\n 'param1',\n 'param2',\n 'param3',\n 'param4',\n 'param5',\n )\n +[\n 'sortorder' => $setorder\n ]);\n \n }\n if (($request->input('param3') == null) && ($request->input('dataype') == 'datetime')){\n $field->update(['param3' => null]);\n }\n return redirect()->route('admin.categories.index')->with('info','Se Actualizo el campo correctamente');\n }",
"function saveEdit() {\r\n $model = $this->getModel('blog_categories');\r\n $app = JFactory::getApplication();\r\n \r\n //Get the $data from the form\r\n $data = $app->input->getArray($_POST); \r\n \r\n //updateKategorie() if the input field is not empty\r\n if($data['title'] != '') {\r\n \t$model->updateKategorieFields(); \t \r\n }\r\n $this->setRedirect('index.php?option=com_ablog&act=blog_categories&task=edit&cid='.(int)$data['id'].'&hidemainmenu=1'); \r\n \r\n }",
"function alterarCategoria() {\n global $connection;\n global $usuario;\n\n $edita_cat_nome = $_POST['categoria_descricao'];\n $dataAtual = DATE('d/m/Y');\n\n $query = \"UPDATE categoria SET categoria_descricao = '$edita_cat_nome', \n categoria_data_alteracao = '$dataAtual',\n categoria_usuario_alteracao = $usuario\n WHERE categoria_codigo = $cat_id\";\n $resultado = mysqli_query($connection, $query);\n if (!$resultado) {\n echo \"Ocorreu um erro ao tentar alterar categoria.\";\n } else {\n echo \"Categoria alterada com sucesso!\";\n }\n}",
"public function editumur()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'statistik', 'update')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\tif ($_SESSION['leveluser'] == '1' OR $_SESSION['leveluser'] == '2') {\n\t\t\t\t$active = $this->postring->valid($_POST['active'], 'xss');\n\t\t\t} else {\n\t\t\t\t$active = \"N\";\n\t\t\t}\n $tanggalbuat = date(\"Y-m-d H:i:s\");\n\t\t\t$statistik = array(\n\t\t\t\t'male' => $_POST['male'],\n\t\t\t\t'female' => $_POST['female'],\n 'editor' => $_SESSION['iduser'],\n\t\t\t\t'active' => $active\n\t\t\t);\n\t\t\t$query_statistik = $this->podb->update('umur')\n\t\t\t\t->set($statistik)\n\t\t\t\t->where('id_umur', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query_statistik->execute();\n\t\t\tforeach ($_POST['umur'] as $id_language => $value) {\n\t\t\t\t$othlang_statistik = $this->podb->from('umur_description')\n\t\t\t\t\t->where('id_umur', $this->postring->valid($_POST['id'], 'sql'))\n\t\t\t\t\t->where('id_language', $id_language)\n\t\t\t\t\t->count();\n\t\t\t\tif ($othlang_statistik > 0) {\n\t\t\t\t\t$statistik_description = array(\n\t\t\t\t\t\t'title' => $this->postring->valid($value['title'], 'xss')\n\t\t\t\t\t);\n\t\t\t\t\t$query_statistik_description = $this->podb->update('umur_description')\n\t\t\t\t\t\t->set($statistik_description)\n\t\t\t\t\t\t->where('id_umur_description', $this->postring->valid($value['id'], 'sql'));\n\t\t\t\t} else {\n\t\t\t\t\t$statistik_description = array(\n\t\t\t\t\t\t'id_umur' => $this->postring->valid($_POST['id'], 'sql'),\n\t\t\t\t\t\t'id_language' => $id_language,\n\t\t\t\t\t\t'title' => $this->postring->valid($value['title'], 'xss')\n\t\t\t\t\t);\n\t\t\t\t\t$query_statistik_description = $this->podb->insertInto('umur_description')->values($statistik_description);\n\t\t\t\t}\n\t\t\t\t$query_statistik_description->execute();\n\t\t\t}\n\t\t\t$this->poflash->success($GLOBALS['_']['statistik_umur_message_2'], 'admin.php?mod=statistik&act=umur');\n\t\t}\n\t\t$id = $this->postring->valid($_GET['id'], 'sql');\n\t\t$current_statistik = $this->podb->from('umur')\n\t\t\t->select('umur_description.title')\n\t\t\t->leftJoin('umur_description ON umur_description.id_umur = umur.id_umur')\n\t\t\t->where('umur.id_umur', $id)\n\t\t\t->limit(1)\n\t\t\t->fetch();\n\t\tif (empty($current_statistik)) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t?>\n\t\t<div class=\"block-content\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->headTitle($GLOBALS['_']['statistik_umur_edit']);?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->formStart(array('method' => 'post', 'action' => 'route.php?mod=statistik&act=editumur&id='.$current_statistik['id_umur'], 'autocomplete' => 'off'));?>\n\t\t\t\t\t\t<?=$this->pohtml->inputHidden(array('name' => 'id', 'value' => $current_statistik['id_umur']));?>\n\t\t\t\t\t\t\n <div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$notab = 1;\n\t\t\t\t\t\t\t\t\t$noctab = 1;\n\t\t\t\t\t\t\t\t\t$langs = $this->podb->from('language')->where('active', 'Y')->orderBy('id_language ASC')->fetchAll();\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<ul class=\"nav nav-tabs\">\n\t\t\t\t\t\t\t\t\t<?php foreach($langs as $lang) { ?>\n\t\t\t\t\t\t\t\t\t<li <?php echo ($notab == '1' ? 'class=\"active\"' : ''); ?>><a href=\"#tab-content-<?=$lang['id_language'];?>\" data-toggle=\"tab\"><img src=\"../<?=DIR_INC;?>/images/flag/<?=$lang['code'];?>.png\" /> <?=$lang['title'];?></a></li>\n\t\t\t\t\t\t\t\t\t<?php $notab++;} ?>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t<div class=\"tab-content\">\n\t\t\t\t\t\t\t\t\t<?php foreach($langs as $lang) { ?>\n\t\t\t\t\t\t\t\t\t\n <?php\n\t\t\t\t\t\t\t\t\t\t$paglang = $this->podb->from('umur_description')\n\t\t\t\t\t\t\t\t\t\t\t->where('umur_description.id_umur', $current_statistik['id_umur'])\n\t\t\t\t\t\t\t\t\t\t\t->where('umur_description.id_language', $lang['id_language'])\n\t\t\t\t\t\t\t\t\t\t\t->fetch();\n\t\t\t\t\t\t\t\t\t?>\n <?=$this->pohtml->inputHidden(array('name' => 'umur['.$lang['id_language'].'][id]', 'value' => $paglang['id_umur_description']));?>\n\t\t\t\t\t\t\t\t\t<div class=\"tab-pane <?php echo ($noctab == '1' ? 'active' : ''); ?>\" id=\"tab-content-<?=$lang['id_language'];?>\">\n\t\t\t\t\t\t\t\t\t\t<?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['statistik_title'], 'name' => 'umur['.$lang['id_language'].'][title]', 'id' => 'title-'.$lang['id_language'], 'value' => $paglang['title'], 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php $noctab++;} ?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['statistik_male'], 'name' => 'male', 'value' => $current_statistik['male'], 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t</div>\n <div class=\"col-md-6\">\n <?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['statistik_female'], 'name' => 'female', 'value' => $current_statistik['female'], 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t</div>\n </div>\n \n <div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($current_statistik['active'] == 'N') {\n\t\t\t\t\t\t\t\t\t\t$radioitem = array(\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'Y', 'options' => '', 'title' => 'Y'),\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'N', 'options' => 'checked', 'title' => 'N')\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo $this->pohtml->inputRadio(array('label' => $GLOBALS['_']['statistik_active'], 'mandatory' => true), $radioitem, $inline = true);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$radioitem = array(\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'Y', 'options' => 'checked', 'title' => 'Y'),\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'N', 'options' => '', 'title' => 'N')\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo $this->pohtml->inputRadio(array('label' => $GLOBALS['_']['statistik_active'], 'mandatory' => true), $radioitem, $inline = true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?=$this->pohtml->formAction();?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?=$this->pohtml->formEnd();?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function editagama()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'statistik', 'update')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\tif ($_SESSION['leveluser'] == '1' OR $_SESSION['leveluser'] == '2') {\n\t\t\t\t$active = $this->postring->valid($_POST['active'], 'xss');\n\t\t\t} else {\n\t\t\t\t$active = \"N\";\n\t\t\t}\n $tanggalbuat = date(\"Y-m-d H:i:s\");\n\t\t\t$statistik = array(\n\t\t\t\t'jumlah' => $_POST['jumlah'],\n 'editor' => $_SESSION['iduser'],\n\t\t\t\t'active' => $active\n\t\t\t);\n\t\t\t$query_statistik = $this->podb->update('agama_penduduk')\n\t\t\t\t->set($statistik)\n\t\t\t\t->where('id_agama', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query_statistik->execute();\n\t\t\tforeach ($_POST['agama'] as $id_language => $value) {\n\t\t\t\t$othlang_statistik = $this->podb->from('agama_penduduk_description')\n\t\t\t\t\t->where('id_agama', $this->postring->valid($_POST['id'], 'sql'))\n\t\t\t\t\t->where('id_language', $id_language)\n\t\t\t\t\t->count();\n\t\t\t\tif ($othlang_statistik > 0) {\n\t\t\t\t\t$statistik_description = array(\n\t\t\t\t\t\t'title' => $this->postring->valid($value['title'], 'xss')\n\t\t\t\t\t);\n\t\t\t\t\t$query_statistik_description = $this->podb->update('agama_penduduk_description')\n\t\t\t\t\t\t->set($statistik_description)\n\t\t\t\t\t\t->where('id_agama_description', $this->postring->valid($value['id'], 'sql'));\n\t\t\t\t} else {\n\t\t\t\t\t$statistik_description = array(\n\t\t\t\t\t\t'id_agama' => $this->postring->valid($_POST['id'], 'sql'),\n\t\t\t\t\t\t'id_language' => $id_language,\n\t\t\t\t\t\t'title' => $this->postring->valid($value['title'], 'xss')\n\t\t\t\t\t);\n\t\t\t\t\t$query_statistik_description = $this->podb->insertInto('agama_description')->values($statistik_description);\n\t\t\t\t}\n\t\t\t\t$query_statistik_description->execute();\n\t\t\t}\n\t\t\t$this->poflash->success($GLOBALS['_']['statistik_agama_message_2'], 'admin.php?mod=statistik&act=agama');\n\t\t}\n\t\t$id = $this->postring->valid($_GET['id'], 'sql');\n\t\t$current_statistik = $this->podb->from('agama_penduduk')\n\t\t\t->select('agama_penduduk_description.title')\n\t\t\t->leftJoin('agama_penduduk_description ON agama_penduduk_description.id_agama = agama_penduduk.id_agama')\n\t\t\t->where('agama_penduduk.id_agama', $id)\n\t\t\t->limit(1)\n\t\t\t->fetch();\n\t\tif (empty($current_statistik)) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\t?>\n\t\t<div class=\"block-content\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->headTitle($GLOBALS['_']['statistik_agama_edit']);?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t<?=$this->pohtml->formStart(array('method' => 'post', 'action' => 'route.php?mod=statistik&act=editagama&id='.$current_statistik['id_agama'], 'autocomplete' => 'off'));?>\n\t\t\t\t\t\t<?=$this->pohtml->inputHidden(array('name' => 'id', 'value' => $current_statistik['id_agama']));?>\n\t\t\t\t\t\t\n <div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t$notab = 1;\n\t\t\t\t\t\t\t\t\t$noctab = 1;\n\t\t\t\t\t\t\t\t\t$langs = $this->podb->from('language')->where('active', 'Y')->orderBy('id_language ASC')->fetchAll();\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<ul class=\"nav nav-tabs\">\n\t\t\t\t\t\t\t\t\t<?php foreach($langs as $lang) { ?>\n\t\t\t\t\t\t\t\t\t<li <?php echo ($notab == '1' ? 'class=\"active\"' : ''); ?>><a href=\"#tab-content-<?=$lang['id_language'];?>\" data-toggle=\"tab\"><img src=\"../<?=DIR_INC;?>/images/flag/<?=$lang['code'];?>.png\" /> <?=$lang['title'];?></a></li>\n\t\t\t\t\t\t\t\t\t<?php $notab++;} ?>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t<div class=\"tab-content\">\n\t\t\t\t\t\t\t\t\t<?php foreach($langs as $lang) { ?>\n\t\t\t\t\t\t\t\t\t\n <?php\n\t\t\t\t\t\t\t\t\t\t$paglang = $this->podb->from('agama_penduduk_description')\n\t\t\t\t\t\t\t\t\t\t\t->where('agama_penduduk_description.id_agama', $current_statistik['id_agama'])\n\t\t\t\t\t\t\t\t\t\t\t->where('agama_penduduk_description.id_language', $lang['id_language'])\n\t\t\t\t\t\t\t\t\t\t\t->fetch();\n\t\t\t\t\t\t\t\t\t?>\n <?=$this->pohtml->inputHidden(array('name' => 'agama['.$lang['id_language'].'][id]', 'value' => $paglang['id_agama_description']));?>\n\t\t\t\t\t\t\t\t\t<div class=\"tab-pane <?php echo ($noctab == '1' ? 'active' : ''); ?>\" id=\"tab-content-<?=$lang['id_language'];?>\">\n\t\t\t\t\t\t\t\t\t\t<?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['statistik_title'], 'name' => 'agama['.$lang['id_language'].'][title]', 'id' => 'title-'.$lang['id_language'], 'value' => $paglang['title'], 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<?php $noctab++;} ?>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n <div class=\"row\">\n <div class=\"col-md-6\">\n <?=$this->pohtml->inputText(array('type' => 'text', 'label' => $GLOBALS['_']['statistik_jumlah'], 'name' => 'jumlah', 'value' => $current_statistik['jumlah'], 'mandatory' => true, 'options' => 'required'));?>\n\t\t\t\t\t\t\t</div>\n </div>\n \n <div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ($current_statistik['active'] == 'N') {\n\t\t\t\t\t\t\t\t\t\t$radioitem = array(\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'Y', 'options' => '', 'title' => 'Y'),\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'N', 'options' => 'checked', 'title' => 'N')\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo $this->pohtml->inputRadio(array('label' => $GLOBALS['_']['statistik_active'], 'mandatory' => true), $radioitem, $inline = true);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$radioitem = array(\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'Y', 'options' => 'checked', 'title' => 'Y'),\n\t\t\t\t\t\t\t\t\t\t\tarray('name' => 'active', 'id' => 'active', 'value' => 'N', 'options' => '', 'title' => 'N')\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo $this->pohtml->inputRadio(array('label' => $GLOBALS['_']['statistik_active'], 'mandatory' => true), $radioitem, $inline = true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-md-12\">\n\t\t\t\t\t\t\t\t<?=$this->pohtml->formAction();?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?=$this->pohtml->formEnd();?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"private function _drawUpdateForm() {\n if ($this->input->post('submit'))\n $data = $this->_getFormValues();\n else {\n $id = $this->uri->segment(4);\n if (!$id)\n $id = $this->input->post('show_id', TRUE);\n if (!$id)\n redirect($this->config->item('admin_path') . 'companies/', 'location');\n $data = $this->general_model->get_single_row_by_id(TBL_companies, 'show_id', $id, 'array');\n if ($data == FALSE)\n redirect($this->config->item('admin_path') . 'companies/', 'location');\n }\n $data['action'] = 'modify';\n $data['page_title'] = 'Company details';\n $data['countriesList'] = $this->general_model->getCountries();\n $data['stateList'] = $this->general_model->getRegions();\n $data['view'] = 'companies/detail_view';\n $this->template->base($data);\n }",
"public function updateCategoria($datos)\n {\n $id= (int)$datos[\"id\"];\n $stmt = Conexion::conectar()->prepare(\"UPDATE categorias SET nombre=:nombre, descripcion=:descripcion WHERE idCategoria=:id\");\n $stmt->bindParam(\":nombre\", $datos[\"nombre\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":descripcion\", $datos[\"descripcion\"] , PDO::PARAM_STR);\n $stmt->bindParam(\":id\", $id);\n if($stmt->execute()){\n return \"success\";\n }else{\n return \"error\";\n }\n $stmt->close();\n \n }"
] | [
"0.6940786",
"0.6854606",
"0.6532719",
"0.6436114",
"0.6398147",
"0.6383415",
"0.63619035",
"0.6329394",
"0.6324051",
"0.63211364",
"0.62864745",
"0.62705785",
"0.6270571",
"0.62530977",
"0.62475556",
"0.6239919",
"0.621372",
"0.6206434",
"0.61989516",
"0.61988837",
"0.6195513",
"0.61947244",
"0.61779416",
"0.61740017",
"0.6170045",
"0.6159487",
"0.61457574",
"0.61341393",
"0.6115787",
"0.61122364"
] | 0.690473 | 1 |
/ ADMIN PICTURE FUNCTION RETRIEVES AN IMAGE FROM ADMIN FOLDER IN: NAME FILENAME OF THE IMAGE TO DISPLAY URL (OPTIONAL) URL TO POINT A LINK TO ALT (OPTIONAL) ALTERNATE TEXT FOR IMAGE OUT: HTML TAG POINTING TO modcp/PICS DIRECTORY | function adminpic($name, $url = "", $alt = "") {
if ($alt == "" AND $alt != null AND defined("_btalt_".$name)) $alt = constant("_btalt_".$name);
$ret = "<img src=\"modcp/pics/".$name."\" border=\"0\" alt=\"".$alt."\" title=\"".$alt."\" />";
if ($url != "") {
return "<a href=\"".$url."\">".$ret."</a>";
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LiangLee_img($params,$picname){\n if (isset($params,$picname)) {\n $path = \"mod/\".$params.\"/media/\";\n echo \"<img src=\\\"\".elgg_get_site_url().$path.$picname.\"\\\">\\n\";\n\t\t} else {\n\t if (elgg_is_admin_logged_in()) {\n register_error(elgg_echo('lianglee:cant:load:img'));\n } else {\n register_error(elgg_echo('lianglee:cant:load:img:code'));\t\n }\n\n }\n}",
"function i($src, $alt='', $htmlOptions=array()){\n $n=strrpos($src, '/');\n if ($n!==false){\n $alt=ldel($src, $n+1);\n $n=strrpos($alt, '.'); \n if ($n!==false){\n $alt=lefts($alt, $n);\n }\n }\n return CHtml::image($src, $alt, $htmlOptions); \n }",
"public function renderThumbnailSrc()\n {\n printf($this->getRelativePath(true), $this->thumbnail_file_name);\n }",
"public function displayImage ($servername) {}",
"public function getImageUrl(){\n return Url::to($this->detailDir.$this->pic); \n }",
"function classymissy_adminpanel_image_preview($src, $backend = true, $default = \"no-image.jpg\") {\n\t$default = ($backend) ? CLASSYMISSY_THEME_URI . \"/framework/theme-options/images/\" . $default : CLASSYMISSY_THEME_URI . \"/images/\" . $default;\n\t$src = ! empty ( $src ) ? $src : $default;\n\t$output = \"<div class='bpanel-option-help'>\\n\";\n\t$output .= \"<a href='' title='' class='a_image_preivew'> <img src='\" . CLASSYMISSY_THEME_URI . \"/framework/theme-options/images/image-preview.png' alt='img' /> </a>\\n\";\n\t$output .= \"\\r<div class='bpanel-option-help-tooltip imagepreview'>\\n\";\n\t$output .= \"\\r<img src='{$src}' data-default='{$default}'/>\";\n\t$output .= \"\\r</div>\\n\";\n\t$output .= \"</div>\\n\";\n\techo ($output);\n}",
"function author_image_path($authorID, $display = true, $type = 'url') {\n switch($type) {\n case 'url' :\n $ref = clean_path(get_settings('siteurl') . pick_image($authorID));\n if ($display) { echo $ref; } else { return $ref; }\n break;\n case 'absolute':\n $ref = clean_path(ABSPATH . pick_image($authorID));\n if ($display) { echo $ref; } else { return $ref; }\n break;\n }\n}",
"function adminentry($name, $op, $title) {\n global $theme;\n $image = \"admin_\".$name.\".jpg\";\n if (file_exists(\"themes/$theme/pics/modcp/\".$image)) {\n $image = \"themes/$theme/pics/modcp/\".$image;\n } else {\n $image = \"modcp/buttons/\".$image;\n }\n\n $img = \"<img src=\\\"\".$image.\"\\\" border=\\\"0\\\" alt=\\\"\".$title.\"\\\" title=\\\"\".$title.\"\\\" /></a><br>\";\n\n echo \"<td align=\\\"center\\\" width=\\\"16%\\\"><p><a href=\\\"modcp.php?op=\".$op.\"#\".$op.\"\\\">\".$img.\"<b>\".$title.\"</b></a><br /><br /></p></td>\\n\";\n}",
"private function showImage()\n\t\t{\n\t\t\t$directory = FN::getSessionValue(\"img-dir\");\n\t\t\t$name = isset($_REQUEST['name']) ? FN::sanitise($_REQUEST['name']) : NULL;\n\t\t\t\n\t\t\t$form = new FORM(\"editImage\", NULL, \"editImage\", \"index.php\", TRUE);\n\t\t\t$form->add(new H1(NULL, NULL, \"Image viewer\"));\n\n\t\t\t$form->add(new DIV(NULL, NULL, \"$directory/$name\"));\n\t\t\t$form->add(new DIV(NULL, NULL, new IMG(NULL, NULL, \"$directory/$name\")));\n\n\t\t\t$form->add($div = new DIV());\n\t\t\t$div->add(new HIDDEN(\"admin\", \"1\"));\n\t\t\t$div->add(new HIDDEN(\"section\", \"image\"));\n\t\t\t$div->add(new HIDDEN(\"directory\", $directory));\n\t\t\t$div->add(new HIDDEN(\"name\", $name));\n\t\t\t$div->add(new SUBMIT(NULL, NULL, \"action\", \"Delete image\"));\n\t\t\t$div->add(new SUBMIT(NULL, NULL, \"action\", \"OK\"));\n\n\t\t\treturn $form;\n\t\t}",
"public function imageAction()\n {\n $model = new Profile_Model_Talentgallery();\n $pictures = $model->getImages(null, 'talent_media2_dance', 'media_dance');\n\n $this->view->allimages = $pictures;\n }",
"function show_article_image($file_name, $displayed_file_name)\n{\t\n\t$path_to_file = \"images/articles\";\n\n\techo \"<div class=\\\"row\\\">\";\n\t\techo \"<div class=\\\"col-lg-4 col-lg-offset-4\\\">\";\n\t\t\techo \"<div class=\\\"thumbnail\\\">\";\n\t\t\t\techo \"<img src=\\\"$path_to_file/$file_name\\\"/>\";\n\t\t\t\techo \"<div class=\\\"caption\\\">\";\n\t\t\t\t\tshow_github_displayed_file_name($path_to_file, $displayed_file_name);\n\t\t\t\techo \"</div>\";\n\t\t\techo \"</div>\";\n\t\techo \"</div>\";\n\techo \"</div>\";\n}",
"public function index2Action() {\n $this->url->setBaseUri('chapter04/url');\n $baseUrl = $this->url->getBaseUri(); \n $imageUrl = $this->url->get('resources/image/redrose.jpg');\n echo $baseUrl;\n echo '<hr>';\n echo $imageUrl;\n }",
"public function renderImageSrc()\n {\n printf($this->getRelativePath(), $this->image_file_name);\n }",
"public function display(){\n\t\t?>\n\t\t<img src='<?=$this->path?>'/>\n\t\t<?php\n\t}",
"function displayImage($imagePath){\r\n\t\r\n\tif(!validRegisteredTempFolder($imagePath)){\r\n\t\tmakeNewFolder($imagePath);\r\n\t}\r\n\tif(!registeredTempFolderExists($imagePath)){\r\n\t\tmakeNewFolder($imagePath);\r\n\t}\r\n\t\r\n\t// Show File to User\r\n\t?>\r\n\t <img class=\"image-file\" src=\"http://localhost/files/<?php echo returnTempPath($imagePath); ?>\">\r\n\t<?php \r\n}",
"public function displayImages ($servername) {}",
"public function getUrl()\n {\n return sfContext::getInstance()->getController()->genUrl(\"@content_thumb?id={$this->getId()}&filename={$this->getFilename()}\", true);\n }",
"function convert_imageTag($string,$coursecode, $instructor){\n //unlike linkTag which support links of docs on server as well as URLs\n $result = $string;\n $baseLink = \"http://student.athabascau.ca/~moshiurho/Comp466_Assignment2/part2/course_files/\"; //where all images lie\n $completeLink = $baseLink.$coursecode.\"_\".$instructor.\"/images/\";\n $replacementLink = \"<img class='educordModuleImage'\".' src=\"'.$completeLink;\n $result = str_replace('<image src=\"', $replacementLink, $result);\n $result = str_replace(\"</image>\", \"</img>\", $result); \n return $result; \n}",
"function get_page_pic_src($ID, $photo_id, $image_type)\n{\n return \"http://u.redlay.com/users/$ID/photos/$photo_id.\".$image_type;\n}",
"function ProdImageLink($prod)\n {\n if ($GLOBALS['EnableSEOUrls'] == 1) { \n return sprintf(\"%s/%s/%s.html\", GetConfig('ShopPath'), PRODUCTIMAGE_LINK_PART, MakeURLSafe($prod));\n } else {\n return sprintf(\"%s/productimage.php?product_id=%s\", GetConfig('ShopPath'), MakeURLSafe($prod));\n } \n }",
"public function actionPicture($picture_id){\n $db_picture = CropPictures::model()->findByPk($picture_id);\n $split_name = explode('.',$db_picture->Picturepath);\n $ftp_path = $split_name[0].'-thumbnail.'.$split_name[1];\n $picture_name = explode('/',$ftp_path);\n $picture_name = $picture_name[count($picture_name)-1];\n \n return \"<img src='assets/\".$picture_name.\"'/>\";\n }",
"public function publicPhoto($folderUser){\n $folder=SERVER_URL.\"system_files/users_data/\".$folderUser.\"/media/\".$folderUser.\".jpg\";\n return \"\".SERVER_URL.\"system_files/modules/resizer/imgresize?src=\".$folder.\"&w=250&h=250&zc=1&a=t\";\n}",
"public static function preview_image_display($field, $form, $value) {\n$input_name = \"input_\" . str_replace('.', '_', $field['id']);\n$file_info = RGFormsModel::get_temp_filename($form['id'], $input_name);\n \n$file_path = $value;\nif(!empty($file_path)){\n$file_path = esc_attr(str_replace(\" \", \"%20\", $file_path));\n$value = \"<a href='$file_path' target='_blank' title='\" . __(\"Click to view\", \"gravityforms\") . \"'>\" . $file_info['uploaded_filename'] . \"</a>\";\n}\nreturn $value;\n \n}",
"function display_image($picture){\n global $upload_directory;\n return $upload_directory . DS . $picture;\n}",
"function image($picName){\n return '<img src=\"images/'.$picName.'\" />';\n}",
"public function imageDisplay( $ioa_options )\n\t{\n\t global $super_options;\n\t extract( array_merge( array( \"src\" => NULL , \"crop\"=> 'hard', \"height\" => 300 , \"width\" => 600 , \"lightbox\" => false , 'parent_wrap' => true , \"hoverable\" => false , \"advance_query\" => false , \"gallery\" => false , \"link\" =>'' , \"title\" => '' , 'class' => '', 'imageAttr' => '' , 'imgclass' => '' ) ,$ioa_options ) );\n\t $o_src = $src;\n\t\n\t \n\t $rel = '';\n\t \n\t if($imageAttr=='') $imageAttr=' alt=\"image\" ';\n\t if($hoverable)\t$hoverable = '<span class=\"hover-image\"> <small></small> </span>';\n\t if($lightbox) { $link = $o_src; $lightbox = 'lightbox'; } \n\t if($gallery) $rel = 'rel=prettyPhoto[pp_gal]';\n\t $retina_image = array(\"url\"=>'');\t\n\t \n\t //if($super_options[SN.'_retina_enable']==\"true\")\n\t //$retina_image = \" data-at2x='\".$this->wp_resize(NULL,$src,$width*2,$height*2,$crop).\"'\";\n\t\t\n\t\t$cr_img = $this->wp_resize(NULL,$src,$width,$height,$crop);\n\t\t\n\n\t\t$image = \" $hoverable <img itemprop='image' $imageAttr class='\".$imgclass.\"' src='\".$cr_img['url'].\"' width='\".$cr_img['width'].\"' height='\".$cr_img['height'].\"' \".$retina_image['url'].\" />\";\n\t\n\t if($parent_wrap) $image = \"<a href='$link' class='$lightbox imageholder $class' title='$title'> $image </a>\";\t\t \t\t\t\t \n\t\t\t \n\t return $image;\n\t}",
"function quiz_print_possible_question_image($question, $courseid) {\n\n global $CFG;\n\n if ($question->image) {\n echo '<img border=\"0\" src=\"';\n\n if (substr(strtolower($question->image), 0, 7) == 'http://') {\n echo $question->image;\n\n } else if ($CFG->slasharguments) { // Use this method if possible for better caching\n echo \"$CFG->wwwroot/file.php/$courseid/$question->image\";\n\n } else {\n echo \"$CFG->wwwroot/file.php?file=$courseid/$question->image\";\n }\n echo '\" alt=\"\" />';\n\n }\n}",
"function maingalleryimg($dbConn, $mgallery_id){\n\t\t$sql = \"SELECT * FROM tbl_mgallery WHERE mgallery_id = '$mgallery_id'\";\n\t\t$result = dbQuery($dbConn, $sql);\n\t\t$row = dbFetchAssoc($result);\n\t\techo\t$name = $row['mgallery_title'];\n\t}",
"public function profilePhoto(){\n $profile_details=$this->setSession();\n $userFolder=$profile_details->folder;\n $folder=SERVER_URL.\"system_files/users_data/\".$userFolder.\"/media/\".$userFolder.\".jpg\";\n \n return \"\".SERVER_URL.\"system_files/modules/resizer/imgresize?src=\".$folder.\"&w=250&h=250&zc=1&a=t\";\n}",
"public function getImageUrl()\n {\n $uploads = Yii::getAlias('@albumes');\n $imagen = glob($uploads . \"/$this->id.*\");\n $s3 = Yii::$app->get('s3');\n\n if (count($imagen) != 0) {\n $ruta = $imagen[0];\n } else {\n $ruta = $uploads . \"/$this->id.jpg\";\n if (!$s3->exist($ruta)) {\n $ruta = $uploads . \"/$this->id.png\";\n }\n }\n\n if (file_exists($ruta)) {\n return \"/$ruta\";\n } elseif ($s3->exist($ruta)) {\n $s3->commands()->get($ruta)->saveAs($ruta)->execute();\n return \"/$ruta\";\n } else {\n return \"/$uploads/disco.png\";\n }\n }"
] | [
"0.7028847",
"0.6655095",
"0.65791696",
"0.65363824",
"0.6512229",
"0.6458282",
"0.642666",
"0.64263046",
"0.64024127",
"0.63593096",
"0.6341175",
"0.63391817",
"0.63256204",
"0.63048446",
"0.62770015",
"0.6267385",
"0.6262448",
"0.62588084",
"0.62361264",
"0.62313485",
"0.6195146",
"0.61859477",
"0.6179319",
"0.6170812",
"0.61582196",
"0.61427855",
"0.6138956",
"0.6124148",
"0.61232996",
"0.612037"
] | 0.74667394 | 0 |
Operation indexCloudBuckets Lists all cloud buckets. | public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function listBuckets();",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function buckets($buckets)\n {\n return $this->bucket->buckets($buckets);\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function getBuckets()\n\t{\n\t\t$buckets = null;\n\n\t\tif (!is_array($buckets))\n\t\t{\n\t\t\t$buckets = array();\n\n\t\t\tif ($this->_hasAdequateInformation(false))\n\t\t\t{\n\t\t\t\t$config = $this->getS3Configuration();\n\t\t\t\t$config->setRegion('us-east-1');\n\n\t\t\t\t$s3 = $this->getS3Connector();\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$buckets = $s3->listBuckets(false);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Swallow the exception\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $buckets;\n\t}",
"public function getAvailableBuckets() {\n $credentials = $this->getCredentials();\n\n $client = Aws\\S3\\S3Client::factory(array(\n 'key' => $credentials['access'],\n 'secret' => $credentials['secret'],\n ));\n\n $data = $client->listBuckets();\n return $data['Buckets'];\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"abstract public function listBuckets();",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function getAwsBuckets() {\n global $s3;\n\n $buckets = $s3->listBuckets();\n $list = [];\n foreach ($buckets['Buckets'] as $bucket){\n $list[] = $bucket['Name'];\n }\n\n return $list;\n}",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"private function indexBuckets($buckets, $indexBy)\n {\n $result = [];\n foreach ($buckets as $key => $models) {\n $result[$key] = [];\n foreach ($models as $model) {\n $index = is_string($indexBy) ? $model[$indexBy] : call_user_func($indexBy, $model);\n $result[$key][$index] = $model;\n }\n }\n\n return $result;\n }",
"public function listBuckets(array $options): ArrayResponse\n {\n return $this->getService($options);\n }",
"public function listKeys(Riak_Bucket $bucket)\n {\n $req = new $this->_classMap[self::MSG_CODE_LIST_KEYS_REQ]();\n $req->setBucket($bucket->getName());\n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_LIST_KEYS_REQ));\n return new Riak_Transport_Iterator($this,'getNextKeyListStack');\n }",
"public function index()\n {\n return view('bucket-list.index');\n }",
"function list_projects() {\n $response = $this->s3->list_buckets();\n $project_list = array();\n foreach ($response->body->Buckets[0] as $bucket_name) {\n echo (string) $bucket_name->Name . PHP_EOL;\n $project_list[] = $bucket_name->Name;\n }\n return $project_list;\n }",
"public function getIndexes(string $db): array\n {\n return $this->request('GET', sprintf('/%s/_index', $db));\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"function get_objects($bucket)\n{\n $objects = array();\n $storage = new StorageClient();\n $bucket = $storage->bucket($bucket);\n foreach ($bucket->objects() as $object) {\n $url = 'https://' . $bucket->name() . '.storage.googleapis.com/' . $object->name();\n $objInfo = array();\n $objInfo[\"name\"] = $object->name();\n $objInfo[\"url\"] = $url;\n array_push($objects, $objInfo);\n }\n return $objects;\n}",
"public function listObjects() {\n if (!$this->bucket) {\n throw new \\Exception('bucket must be defined');\n }\n\n $result = $this->client->listObjects([\n 'Bucket' => $this->bucket, // REQUIRED\n ]);\n\n return $result;\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function ListClusters(\\Google\\Cloud\\Bigtable\\Admin\\V2\\ListClustersRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.bigtable.admin.v2.BigtableInstanceAdmin/ListClusters',\n $argument,\n ['\\Google\\Cloud\\Bigtable\\Admin\\V2\\ListClustersResponse', 'decode'],\n $metadata, $options);\n }"
] | [
"0.593412",
"0.54224783",
"0.5355611",
"0.52912617",
"0.51453257",
"0.50015783",
"0.4911376",
"0.48642468",
"0.48353004",
"0.48318562",
"0.47108808",
"0.4689129",
"0.46424603",
"0.45620653",
"0.4509471",
"0.45077232",
"0.4464174",
"0.4379817",
"0.43162504",
"0.4268862",
"0.42437348",
"0.4230092",
"0.42014834",
"0.4184165",
"0.41460565",
"0.4131078",
"0.40683058",
"0.40513968",
"0.4045073",
"0.39516827"
] | 0.7288968 | 0 |
Operation indexCloudBucketsWithHttpInfo Lists all cloud buckets. | public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
$request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 200:
if ('\NodeumSDK\Client\Model\CloudBucketCollection' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\CloudBucketCollection', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\NodeumSDK\Client\Model\CloudBucketCollection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\CloudBucketCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"abstract public function info($bucket, $name);",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getBuckets()\n\t{\n\t\t$buckets = null;\n\n\t\tif (!is_array($buckets))\n\t\t{\n\t\t\t$buckets = array();\n\n\t\t\tif ($this->_hasAdequateInformation(false))\n\t\t\t{\n\t\t\t\t$config = $this->getS3Configuration();\n\t\t\t\t$config->setRegion('us-east-1');\n\n\t\t\t\t$s3 = $this->getS3Connector();\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$buckets = $s3->listBuckets(false);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Swallow the exception\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $buckets;\n\t}",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function listBuckets(array $options): ArrayResponse\n {\n return $this->getService($options);\n }",
"public function getAvailableBuckets() {\n $credentials = $this->getCredentials();\n\n $client = Aws\\S3\\S3Client::factory(array(\n 'key' => $credentials['access'],\n 'secret' => $credentials['secret'],\n ));\n\n $data = $client->listBuckets();\n return $data['Buckets'];\n }",
"public function putBucket($bucketName);",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBuckets();"
] | [
"0.69355166",
"0.5845603",
"0.5694026",
"0.5388395",
"0.5355372",
"0.53143376",
"0.5250171",
"0.4991687",
"0.48948038",
"0.4875487",
"0.4733384",
"0.46764123",
"0.46344164",
"0.46133634",
"0.45969924",
"0.45460355",
"0.45053986",
"0.44830206",
"0.44771603",
"0.44594365",
"0.4452738",
"0.44468638",
"0.44358143",
"0.44171536",
"0.43895197",
"0.43882933",
"0.43682763",
"0.42852822",
"0.4276433",
"0.42363095"
] | 0.6243398 | 1 |
Operation indexCloudBucketsAsync Lists all cloud buckets. | public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function listBuckets();",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function listBuckets(array $options): ArrayResponse\n {\n return $this->getService($options);\n }",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"public function indexApiKeysAsync($limit = null, $offset = null)\n {\n return $this->indexApiKeysAsyncWithHttpInfo($limit, $offset)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function getBuckets()\n\t{\n\t\t$buckets = null;\n\n\t\tif (!is_array($buckets))\n\t\t{\n\t\t\t$buckets = array();\n\n\t\t\tif ($this->_hasAdequateInformation(false))\n\t\t\t{\n\t\t\t\t$config = $this->getS3Configuration();\n\t\t\t\t$config->setRegion('us-east-1');\n\n\t\t\t\t$s3 = $this->getS3Connector();\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$buckets = $s3->listBuckets(false);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Swallow the exception\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $buckets;\n\t}",
"public function getAvailableBuckets() {\n $credentials = $this->getCredentials();\n\n $client = Aws\\S3\\S3Client::factory(array(\n 'key' => $credentials['access'],\n 'secret' => $credentials['secret'],\n ));\n\n $data = $client->listBuckets();\n return $data['Buckets'];\n }",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"abstract public function listBuckets();",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function buckets($buckets)\n {\n return $this->bucket->buckets($buckets);\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexConfigurationsAsync($limit = null, $offset = null)\n {\n return $this->indexConfigurationsAsyncWithHttpInfo($limit, $offset)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listObjects() {\n if (!$this->bucket) {\n throw new \\Exception('bucket must be defined');\n }\n\n $result = $this->client->listObjects([\n 'Bucket' => $this->bucket, // REQUIRED\n ]);\n\n return $result;\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"function getAwsBuckets() {\n global $s3;\n\n $buckets = $s3->listBuckets();\n $list = [];\n foreach ($buckets['Buckets'] as $bucket){\n $list[] = $bucket['Name'];\n }\n\n return $list;\n}"
] | [
"0.65959436",
"0.5354662",
"0.52626246",
"0.50767523",
"0.5046667",
"0.50172466",
"0.492461",
"0.47832143",
"0.4754516",
"0.47335592",
"0.46888083",
"0.46876225",
"0.4674397",
"0.4665259",
"0.46274337",
"0.45333934",
"0.44526988",
"0.4430313",
"0.44247445",
"0.43459007",
"0.42812267",
"0.4245554",
"0.4240577",
"0.42272815",
"0.41454002",
"0.412389",
"0.41131854",
"0.40940994",
"0.40530646",
"0.40498912"
] | 0.58837837 | 1 |
Operation indexCloudBucketsAsyncWithHttpInfo Lists all cloud buckets. | public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucketCollection';
$request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexApiKeysAsyncWithHttpInfo($limit = null, $offset = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ApiKeyCollection';\n $request = $this->indexApiKeysRequest($limit, $offset);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBuckets(array $options): ArrayResponse\n {\n return $this->getService($options);\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexApiKeysAsync($limit = null, $offset = null)\n {\n return $this->indexApiKeysAsyncWithHttpInfo($limit, $offset)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function restExportsFormatKeysGetAsyncWithHttpInfo()\n {\n $returnType = 'object[]';\n $request = $this->restExportsFormatKeysGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getBuckets()\n\t{\n\t\t$buckets = null;\n\n\t\tif (!is_array($buckets))\n\t\t{\n\t\t\t$buckets = array();\n\n\t\t\tif ($this->_hasAdequateInformation(false))\n\t\t\t{\n\t\t\t\t$config = $this->getS3Configuration();\n\t\t\t\t$config->setRegion('us-east-1');\n\n\t\t\t\t$s3 = $this->getS3Connector();\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$buckets = $s3->listBuckets(false);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Swallow the exception\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $buckets;\n\t}"
] | [
"0.6744202",
"0.5972045",
"0.58261913",
"0.5617302",
"0.55999213",
"0.5572492",
"0.53723663",
"0.5102326",
"0.5054401",
"0.50237066",
"0.4945596",
"0.48986256",
"0.48163918",
"0.47551367",
"0.46620965",
"0.46308473",
"0.4624308",
"0.4565838",
"0.45404762",
"0.45224994",
"0.4488231",
"0.44763258",
"0.4455515",
"0.43927255",
"0.43667343",
"0.43553618",
"0.43433064",
"0.4325096",
"0.42924637",
"0.4280063"
] | 0.62995523 | 1 |
Create request for operation 'indexCloudBuckets' | protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
$resourcePath = '/cloud_buckets';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if (is_array($limit)) {
$limit = ObjectSerializer::serializeCollection($limit, '', true);
}
if ($limit !== null) {
$queryParams['limit'] = $limit;
}
// query params
if (is_array($offset)) {
$offset = ObjectSerializer::serializeCollection($offset, '', true);
}
if ($offset !== null) {
$queryParams['offset'] = $offset;
}
// query params
if (is_array($sort_by)) {
$sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);
}
if ($sort_by !== null) {
$queryParams['sort_by'] = $sort_by;
}
// query params
if (is_array($id)) {
$id = ObjectSerializer::serializeCollection($id, '', true);
}
if ($id !== null) {
$queryParams['id'] = $id;
}
// query params
if (is_array($cloud_connector_id)) {
$cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);
}
if ($cloud_connector_id !== null) {
$queryParams['cloud_connector_id'] = $cloud_connector_id;
}
// query params
if (is_array($pool_id)) {
$pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);
}
if ($pool_id !== null) {
$queryParams['pool_id'] = $pool_id;
}
// query params
if (is_array($name)) {
$name = ObjectSerializer::serializeCollection($name, '', true);
}
if ($name !== null) {
$queryParams['name'] = $name;
}
// query params
if (is_array($location)) {
$location = ObjectSerializer::serializeCollection($location, '', true);
}
if ($location !== null) {
$queryParams['location'] = $location;
}
// query params
if (is_array($price)) {
$price = ObjectSerializer::serializeCollection($price, '', true);
}
if ($price !== null) {
$queryParams['price'] = $price;
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listBuckets();",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract public function listBuckets();",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"public function search2i($bucket, $index, $queryType = 0, $key = null, $rangeMin = null, $rangeMax = null) \n {\n $req = new $this->_classMap[self::MSG_CODE_INDEX_REQ]();\n $req->setBucket($bucket);\n $req->setIndex($index);\n $req->setQtype($queryType);\n if ($key) {\n $req->setKey($key);\n }\n if ($rangeMin) {\n $req->setRangeMin($rangeMin);\n }\n if ($rangeMax) {\n $req->setRangeMax($rangeMax);\n }\n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_INDEX_REQ));\n list($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_INDEX_RESP) {\n if ($response->hasKeys()) {\n return $response->getKeysList();\n } else {\n return array();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer message code: \" . $messageCode);\n }\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function query(Query $query):Bucket;",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function createIndex(){\n\t\t$indexParams['index'] = self::ELASTIC_INDEX_NAME;\n\n\t\t//Pour chercher des bouts de mots\n\t\t$indexParams['body']['settings']['analysis']['filter']['nGram_filter'] = array(\n\t\t\t\t\"type\" => \"nGram\",\n\t\t\t\t\"min_gram\" => 2,\n\t\t\t\t\"max_gram\" => 20,\n\t\t\t\t\"token_chars\" => array (\n\t\t\t\t\t\t\"letter\",\n\t\t\t\t\t\t\"digit\",\n\t\t\t\t\t\t\"punctuation\",\n\t\t\t\t\t\t\"symbol\"\n\t\t\t\t)\n\t\t);\n\t\t$indexParams['body']['settings']['analysis']['analyzer']['nGram_analyzer'] = array(\n\t\t\t\t\"type\" => \"custom\",\n\t\t\t\t\"tokenizer\" => \"whitespace\",\n\t\t\t\t\"filter\" => array(\"lowercase\", \"asciifolding\", \"nGram_filter\")\n\t\t);\n\n\n\t\t$indexParams['body']['settings']['analysis']['analyzer']['whitespace_analyzer'] = array(\n\t\t\t\t\"type\" => \"custom\",\n\t\t\t\t\"tokenizer\" => \"whitespace\",\n\t\t\t\t\"filter\" => array(\"lowercase\", \"asciifolding\")\n\t\t);\n\n\t\t//Analyzer pour trier en ignorant la casse\n\t\t$indexParams['body']['settings']['analysis']['analyzer']['case_insensitive_sort'] = array(\n\t\t\t\t\"tokenizer\" => \"keyword\",\n\t\t\t\t\"filter\" => array(\"lowercase\")\n\t\t);\n\n\t\t$datasetMapping = file_get_contents(self::ELASTIC_DATASET_MAPPING, true);\n\t\t$map = json_decode($datasetMapping, true);\n\t\t$indexParams['body']['mappings'][self::ELASTIC_DATASET_TYPE] = $map;\n\n\t\t$keywordMapping = file_get_contents(self::ELASTIC_KEYWORD_MAPPING, true);\n\t\t$map2 = json_decode($keywordMapping, true);\n\t\t$indexParams['body']['mappings'][self::ELASTIC_KEYWORD_TYPE] = $map2;\n\n\t\treturn $this->client->indices()->create($indexParams);\n\t}",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function index()\n {\n $params = $this->basicElasticParams(true);\n $params['body'] = $this->documentFields();\n\n return $this->getElasticClient()->index($params);\n }",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"public function createIndex();",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public static function createIndex()\n {\n $instance = new static;\n $params = [\n 'index' => $instance->getIndex()\n ];\n \n $response = $instance->getElasticClient()->indices()->create($params);\n \n return $response;\n }",
"public function getBucket($name, $type = null) {}",
"function getNewIndexItems($indexName, $organizationFieldName, $lastSyncTime) {\n $address = Settings::getValue('elastic-url') . '/' . $indexName . '/_search';\n $username = Settings::getValue('elastic-username');\n $password = Settings::getValue('elastic-password');\n\n $login = $username . ':'. $password;\n $base64Login = base64_encode($login);\n $requestBody = [\n 'size' => 10000,\n 'query' => [\n 'bool' => [\n 'must' => [\n [\n 'terms' => [\n $organizationFieldName => array_values(Settings::getOrganizationIds())\n ]\n ], \n [\n 'range' => [\n 'creationDate'=> [\n 'gte' => empty($lastSyncTime) ? null : $lastSyncTime\n ]\n ]\n ]\n ]\n ] \n ]\n ];\n\n $result = wp_remote_post($address, [\n 'headers' => [\n 'Authorization' => 'Basic ' . $base64Login,\n 'Content-Type' => 'application/json'\n ],\n 'body' => json_encode($requestBody)\n ]);\n\n return json_decode(wp_remote_retrieve_body($result))->hits->hits;\n }"
] | [
"0.58397424",
"0.5834603",
"0.5748922",
"0.5666929",
"0.56575704",
"0.5507138",
"0.5504696",
"0.5421388",
"0.536445",
"0.53577006",
"0.5309192",
"0.5176729",
"0.5166426",
"0.5152044",
"0.5147041",
"0.51284015",
"0.5094582",
"0.50850636",
"0.5073596",
"0.5066463",
"0.50411147",
"0.503716",
"0.50133026",
"0.50010914",
"0.49580732",
"0.49338636",
"0.4932419",
"0.48814166",
"0.47944066",
"0.4793832"
] | 0.6528352 | 0 |
Operation indexCloudBucketsByCloudConnector Lists all cloud buckets. | public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function listBuckets();",
"public function listBuckets()\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\t$result = $this->client->listBuckets();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch (\\Aws\\S3\\Exception\\S3Exception $e)\n\t\t{\n\t\t\techo $e->getMessage();\n\t\t}\n\t}",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function buckets($buckets)\n {\n return $this->bucket->buckets($buckets);\n }",
"public function getAvailableBuckets() {\n $credentials = $this->getCredentials();\n\n $client = Aws\\S3\\S3Client::factory(array(\n 'key' => $credentials['access'],\n 'secret' => $credentials['secret'],\n ));\n\n $data = $client->listBuckets();\n return $data['Buckets'];\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getBuckets()\n\t{\n\t\t$buckets = null;\n\n\t\tif (!is_array($buckets))\n\t\t{\n\t\t\t$buckets = array();\n\n\t\t\tif ($this->_hasAdequateInformation(false))\n\t\t\t{\n\t\t\t\t$config = $this->getS3Configuration();\n\t\t\t\t$config->setRegion('us-east-1');\n\n\t\t\t\t$s3 = $this->getS3Connector();\n\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$buckets = $s3->listBuckets(false);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $e)\n\t\t\t\t{\n\t\t\t\t\t// Swallow the exception\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $buckets;\n\t}",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"abstract public function listBuckets();",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"function getAwsBuckets() {\n global $s3;\n\n $buckets = $s3->listBuckets();\n $list = [];\n foreach ($buckets['Buckets'] as $bucket){\n $list[] = $bucket['Name'];\n }\n\n return $list;\n}",
"public function ListAppConnectors(\\Google\\Cloud\\BeyondCorp\\AppConnectors\\V1\\ListAppConnectorsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/ListAppConnectors',\n $argument,\n ['\\Google\\Cloud\\BeyondCorp\\AppConnectors\\V1\\ListAppConnectorsResponse', 'decode'],\n $metadata, $options);\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"static function searchBucketsByBucketName($bucketName,$database)\n\t{\n\t\t\n\t\t$sql = \"SELECT * from BUCKET where BUCKET_NAME = '{$bucketName}'\";\n\t\t$res = $database->query($sql);\n\t\treturn $res;\n\t}",
"public function listObjects() {\n if (!$this->bucket) {\n throw new \\Exception('bucket must be defined');\n }\n\n $result = $this->client->listObjects([\n 'Bucket' => $this->bucket, // REQUIRED\n ]);\n\n return $result;\n }",
"public function listObjects()\n {\n $listBlobOption = new ListBlobsOptions();\n\n $listBlobOption->setPrefix($this->container);\n\n return $this->client->listBlob($this->container, $listBlobOption)->getBlobs();\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.68400836",
"0.58246887",
"0.58159286",
"0.5781882",
"0.54097956",
"0.5408916",
"0.5393187",
"0.536816",
"0.5304697",
"0.5287886",
"0.5261323",
"0.52436036",
"0.51849246",
"0.51308066",
"0.5041233",
"0.5040371",
"0.4942761",
"0.4905132",
"0.48118892",
"0.47989732",
"0.47749504",
"0.46544778",
"0.46461323",
"0.45803",
"0.4568802",
"0.45663851",
"0.45557094",
"0.4547492",
"0.4528768",
"0.45042685"
] | 0.7661437 | 0 |
Create request for operation 'indexCloudBucketsByCloudConnector' | protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if (is_array($limit)) {
$limit = ObjectSerializer::serializeCollection($limit, '', true);
}
if ($limit !== null) {
$queryParams['limit'] = $limit;
}
// query params
if (is_array($offset)) {
$offset = ObjectSerializer::serializeCollection($offset, '', true);
}
if ($offset !== null) {
$queryParams['offset'] = $offset;
}
// query params
if (is_array($sort_by)) {
$sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);
}
if ($sort_by !== null) {
$queryParams['sort_by'] = $sort_by;
}
// query params
if (is_array($id)) {
$id = ObjectSerializer::serializeCollection($id, '', true);
}
if ($id !== null) {
$queryParams['id'] = $id;
}
// query params
if (is_array($pool_id)) {
$pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);
}
if ($pool_id !== null) {
$queryParams['pool_id'] = $pool_id;
}
// query params
if (is_array($name)) {
$name = ObjectSerializer::serializeCollection($name, '', true);
}
if ($name !== null) {
$queryParams['name'] = $name;
}
// query params
if (is_array($location)) {
$location = ObjectSerializer::serializeCollection($location, '', true);
}
if ($location !== null) {
$queryParams['location'] = $location;
}
// query params
if (is_array($price)) {
$price = ObjectSerializer::serializeCollection($price, '', true);
}
if ($price !== null) {
$queryParams['price'] = $price;
}
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function listBuckets();",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"static function searchBucketsByBucketName($bucketName,$database)\n\t{\n\t\t\n\t\t$sql = \"SELECT * from BUCKET where BUCKET_NAME = '{$bucketName}'\";\n\t\t$res = $database->query($sql);\n\t\treturn $res;\n\t}",
"abstract public function listBuckets();",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function query(Query $query):Bucket;",
"public function getBucket($name, $type = null) {}",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public function search2i($bucket, $index, $queryType = 0, $key = null, $rangeMin = null, $rangeMax = null) \n {\n $req = new $this->_classMap[self::MSG_CODE_INDEX_REQ]();\n $req->setBucket($bucket);\n $req->setIndex($index);\n $req->setQtype($queryType);\n if ($key) {\n $req->setKey($key);\n }\n if ($rangeMin) {\n $req->setRangeMin($rangeMin);\n }\n if ($rangeMax) {\n $req->setRangeMax($rangeMax);\n }\n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_INDEX_REQ));\n list($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_INDEX_RESP) {\n if ($response->hasKeys()) {\n return $response->getKeysList();\n } else {\n return array();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer message code: \" . $messageCode);\n }\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }"
] | [
"0.609271",
"0.6059826",
"0.5873297",
"0.56400406",
"0.55738324",
"0.55651057",
"0.55535716",
"0.55293065",
"0.54578537",
"0.5444719",
"0.54440945",
"0.5285132",
"0.52466774",
"0.51830506",
"0.5103389",
"0.5081109",
"0.50754046",
"0.50145185",
"0.49976474",
"0.49827668",
"0.49635354",
"0.49605194",
"0.49491656",
"0.4943574",
"0.49321672",
"0.49016634",
"0.48915696",
"0.48760912",
"0.48550382",
"0.48385403"
] | 0.644703 | 0 |
Operation indexCloudBucketsByPool Lists all cloud buckets from pool. | public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)
{
list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"private function indexBuckets($buckets, $indexBy)\n {\n $result = [];\n foreach ($buckets as $key => $models) {\n $result[$key] = [];\n foreach ($models as $model) {\n $index = is_string($indexBy) ? $model[$indexBy] : call_user_func($indexBy, $model);\n $result[$key][$index] = $model;\n }\n }\n\n return $result;\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function listBuckets();",
"public function getPools()\n {\n return $this->get('/pools');\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPool($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n list($response) = $this->indexFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"public function pools()\n {\n return $this->get('/user/load_balancers/pools');\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"protected function getIndexCollection(MappingCollection $mappingCollection)\n {\n return $this->container->indexPool->buildIndexCollection($mappingCollection);\n }",
"static function searchBucketsByBucketName($bucketName,$database)\n\t{\n\t\t\n\t\t$sql = \"SELECT * from BUCKET where BUCKET_NAME = '{$bucketName}'\";\n\t\t$res = $database->query($sql);\n\t\treturn $res;\n\t}",
"private static function createPools($app)\n {\n $pools = new \\Pimple();\n\n foreach ($app['pools.options'] as $name => $options) {\n $pool = new \\Stash\\Pool(self::fetchDriver($options));\n $pool->setLogger(self::fetchLogger($app, $options));\n\n $pools[$name] = $pools->share(function () use ($pool) {\n return $pool;\n });\n\n }\n\n return $pools;\n }",
"abstract public function listBuckets();",
"public function buckets($buckets)\n {\n return $this->bucket->buckets($buckets);\n }",
"protected function getIndices($tableName) {\r\n\t\tif(!isset($this->databaseIndices)) {\r\n\t\t\t$this->databaseIndices = array();\r\n\t\t\t\r\n\t\t\tif(WCF::getDB() instanceof MySQLDatabase) {\r\n\t\t\t\t$sql = \"SELECT\t*\r\n\t\t\t\t\tFROM\tINFORMATION_SCHEMA.STATISTICS\r\n\t\t\t\t\tWHERE\tTABLE_SCHEMA = ?\"; \r\n\t\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\r\n\t\t\t\t$statement->execute(array(WCF::getDB()->getDatabaseName()));\r\n\t\t\t\t\r\n\t\t\t\twhile($row = $statement->fetchArray()) {\r\n\t\t\t\t\t// Ignore INDEX names which end in \"_fk\", because its an\r\n\t\t\t\t\t// WCF convention for foreign keys\r\n\t\t\t\t\t// @see https://community.woltlab.com/thread/246501-sql-log-foreign-key-index-namen-immer-mit-fk-suffix/\r\n\t\t\t\t\tif(mb_substr($row['INDEX_NAME'], -3) == '_fk') {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If index was already seen, only add the column...\r\n\t\t\t\t\tif(isset($this->databaseIndices[$row['TABLE_NAME']][$row['INDEX_NAME']])) {\r\n\t\t\t\t\t\t$this->databaseIndices[$row['TABLE_NAME']][$row['INDEX_NAME']]['columns'][] = $row['COLUMN_NAME'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// ... otherwise add the complete index data\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif($row['INDEX_NAME'] == 'PRIMARY') $type = 'PRIMARY';\r\n\t\t\t\t\t\telseif(!$row['NON_UNIQUE']) $type = 'UNIQUE';\r\n\t\t\t\t\t\telseif($row['INDEX_TYPE'] == 'FULLTEXT') $type = 'FULLTEXT';\r\n\t\t\t\t\t\telse $type = 'INDEX';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->databaseIndices[$row['TABLE_NAME']][$row['INDEX_NAME']] = array(\r\n\t\t\t\t\t\t\t'tableName' => $row['TABLE_NAME'],\r\n\t\t\t\t\t\t\t'indexName' => $row['INDEX_NAME'],\r\n\t\t\t\t\t\t\t'columns' => array($row['COLUMN_NAME']),\r\n\t\t\t\t\t\t\t'type' => $type\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} elseif(WCF::getDB() instanceof PostgreSQLDatabase) {\r\n\t\t\t\t$sql = \"SELECT\t\tt.relname AS tableName,\r\n\t\t\t\t\t\t\ti.relname AS indexName,\r\n\t\t\t\t\t\t\ta.attname AS columnName,\r\n\t\t\t\t\t\t\tix.indisunique AS isUnique,\r\n\t\t\t\t\t\t\tix.indisprimary AS isPrimary,\r\n\t\t\t\t\tFROM\t\tpg_class t,\r\n\t\t\t\t\t\t\tpg_class i,\r\n\t\t\t\t\t\t\tpg_index ix,\r\n\t\t\t\t\t\t\tpg_attribute a\r\n\t\t\t\t\tWHERE\t\tt.oid = ix.indrelid\r\n\t\t\t\t\tAND\t\ti.oid = ix.indexrelid\r\n\t\t\t\t\tAND\t\ta.attrelid = t.oid\r\n\t\t\t\t\tAND\t\ta.attnum = ANY(ix.indkey)\r\n\t\t\t\t\tAND\t\tt.relkind = 'r'\r\n\t\t\t\t\tORDER BY\tt.relname,\r\n\t\t\t\t\t\t\ti.relname\";\r\n\t\t\t\t$statement = WCF::getDB()->prepareStatement($sql);\r\n\t\t\t\t$statement->execute();\r\n\t\t\t\twhile($row = $statement->fetchArray()) {\r\n\t\t\t\t\t// Ignore INDEX names which end in \"_fk\" as WCF convention\r\n\t\t\t\t\t// @see https://community.woltlab.com/thread/246501-sql-log-foreign-key-index-namen-immer-mit-fk-suffix/\r\n\t\t\t\t\tif(mb_substr($row['indexName'], -3) == '_fk') continue;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If index was already seen, only add the column...\r\n\t\t\t\t\tif(isset($this->databaseIndices[$row['tableName']][$row['indexName']])) {\r\n\t\t\t\t\t\t$this->databaseIndices[$row['tableName']][$row['indexName']]['columns'][] = $row['columnName'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// ... otherwise add the complete index data\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif($row['isPrimary']) $type = 'PRIMARY';\r\n\t\t\t\t\t\telseif($row['isUnique']) $type = 'UNIQUE';\r\n\t\t\t\t\t\telseif(mb_strpos($row['indexName'], '_fulltext_key') !== false) $type = 'FULLTEXT';\r\n\t\t\t\t\t\telse $type = 'INDEX';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->databaseIndices[$row['tableName']][$row['indexName']] = array(\r\n\t\t\t\t\t\t\t'tableName' => $row['tableName'],\r\n\t\t\t\t\t\t\t'indexName' => $row['indexName'],\r\n\t\t\t\t\t\t\t'columns' => array($row['columnName']),\r\n\t\t\t\t\t\t\t'type' => $type\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthrow new UnsupportedDatabaseException();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check if table does not exist or has no indices: set empty array\r\n\t\tif(!isset($this->databaseIndices[$tableName])) {\r\n\t\t\t$this->databaseIndices[$tableName] = array();\r\n\t\t}\r\n\r\n\t\treturn $this->databaseIndices[$tableName];\r\n\t}"
] | [
"0.63327056",
"0.61023086",
"0.6100244",
"0.5810443",
"0.5701083",
"0.55327475",
"0.549519",
"0.54061496",
"0.53233695",
"0.51556236",
"0.5130013",
"0.49942303",
"0.48436967",
"0.48283052",
"0.47807848",
"0.4769838",
"0.4747359",
"0.47256538",
"0.4697094",
"0.4672522",
"0.45885852",
"0.4580992",
"0.45472133",
"0.44901836",
"0.44757995",
"0.44504735",
"0.4436644",
"0.44228432",
"0.4420848",
"0.4413247"
] | 0.80488145 | 0 |
Operation indexCloudBucketsByPoolWithHttpInfo Lists all cloud buckets from pool. | public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)
{
$request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 200:
if ('\NodeumSDK\Client\Model\CloudBucketCollection' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\CloudBucketCollection', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\NodeumSDK\Client\Model\CloudBucketCollection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\CloudBucketCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPool($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n list($response) = $this->indexFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NodeumFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NodeumFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NodeumFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"public function indexOnTapesFilesByPool($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n list($response) = $this->indexOnTapesFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size);\n return $response;\n }",
"public function indexOnTapesFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\OnTapesFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"private function indexBuckets($buckets, $indexBy)\n {\n $result = [];\n foreach ($buckets as $key => $models) {\n $result[$key] = [];\n foreach ($models as $model) {\n $index = is_string($indexBy) ? $model[$indexBy] : call_user_func($indexBy, $model);\n $result[$key][$index] = $model;\n }\n }\n\n return $result;\n }",
"public function indexTapesByFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $request = $this->indexTapesByFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexImportFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getPools()\n {\n return $this->get('/pools');\n }",
"public function indexImportFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\ImportFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ImportFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ImportFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexOnTapesFilesByPoolAsync($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n return $this->indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.7805568",
"0.64700896",
"0.6344753",
"0.6327637",
"0.6072298",
"0.60652745",
"0.5750858",
"0.5719513",
"0.56907475",
"0.56567127",
"0.5235864",
"0.4959432",
"0.49186102",
"0.48363853",
"0.48114127",
"0.47299826",
"0.47298363",
"0.47242367",
"0.46882877",
"0.46512157",
"0.45310044",
"0.44423783",
"0.44105828",
"0.43995684",
"0.4381973",
"0.43545514",
"0.42657685",
"0.41634393",
"0.41619888",
"0.40975562"
] | 0.69604945 | 1 |
Operation indexCloudBucketsByPoolAsync Lists all cloud buckets from pool. | public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)
{
return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getPools()\n {\n return $this->get('/pools');\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function indexBuckets($buckets, $indexBy)\n {\n $result = [];\n foreach ($buckets as $key => $models) {\n $result[$key] = [];\n foreach ($models as $model) {\n $index = is_string($indexBy) ? $model[$indexBy] : call_user_func($indexBy, $model);\n $result[$key][$index] = $model;\n }\n }\n\n return $result;\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function pools()\n {\n return $this->get('/user/load_balancers/pools');\n }",
"public function indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function listBuckets();",
"public function listActiveStoragePool(){\n return libvirt_list_active_storagepools($this->connection);\n }",
"public function listIndexes() {\n return AlgoliaUtils_request($this->curlHandle, $this->hostsArray, \"GET\", \"/1/indexes/\");\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function listStoragePool(){\n return libvirt_list_storagepools($this->connection);\n }",
"public function listInActiveStoragePool(){\n return libvirt_list_inactive_storagepools($this->connection);\n }",
"public function pools()\n {\n return $this->get('/agents/pools');\n }",
"public function actionIndex()\n {\n $searchModel = new TaskPoolSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }"
] | [
"0.75122607",
"0.60587114",
"0.598779",
"0.5739908",
"0.5584319",
"0.5538605",
"0.5346061",
"0.52719706",
"0.5233996",
"0.5232211",
"0.5146682",
"0.50796336",
"0.50186867",
"0.50170135",
"0.47617513",
"0.46581966",
"0.4575248",
"0.45628935",
"0.45193014",
"0.45012027",
"0.4464208",
"0.44528466",
"0.4409282",
"0.4392726",
"0.43731055",
"0.4366906",
"0.42707917",
"0.42598632",
"0.42312986",
"0.42098853"
] | 0.6125164 | 1 |
Operation indexCloudBucketsByPoolAsyncWithHttpInfo Lists all cloud buckets from pool. | public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucketCollection';
$request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexImportFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"public function indexFilesByPool($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n list($response) = $this->indexFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n return $response;\n }",
"public function indexOnTapesFilesByPoolAsync($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n return $this->indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexTapesByFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $request = $this->indexTapesByFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listPoolServersAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\ServerResponse[]';\n $request = $this->listPoolServersRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NodeumFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NodeumFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NodeumFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getPools()\n {\n return $this->get('/pools');\n }",
"public function indexOnTapesFilesByPool($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n list($response) = $this->indexOnTapesFilesByPoolWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size);\n return $response;\n }",
"public function indexOnTapesFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\OnTapesFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.7480396",
"0.66540456",
"0.6086208",
"0.60050976",
"0.59842485",
"0.5946215",
"0.59245837",
"0.57795256",
"0.5675703",
"0.55289745",
"0.5279255",
"0.5176867",
"0.50394326",
"0.49963948",
"0.49507213",
"0.49434662",
"0.46777672",
"0.46313584",
"0.46232343",
"0.45350868",
"0.4490344",
"0.44673556",
"0.44343552",
"0.4430568",
"0.44284624",
"0.4405372",
"0.43152493",
"0.42642993",
"0.42373013",
"0.42307082"
] | 0.67462164 | 1 |
Create request for operation 'indexCloudBucketsByPool' | protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)
{
// verify the required parameter 'pool_id' is set
if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'
);
}
$resourcePath = '/pools/{pool_id}/cloud_buckets';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if (is_array($limit)) {
$limit = ObjectSerializer::serializeCollection($limit, '', true);
}
if ($limit !== null) {
$queryParams['limit'] = $limit;
}
// query params
if (is_array($offset)) {
$offset = ObjectSerializer::serializeCollection($offset, '', true);
}
if ($offset !== null) {
$queryParams['offset'] = $offset;
}
// query params
if (is_array($sort_by)) {
$sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);
}
if ($sort_by !== null) {
$queryParams['sort_by'] = $sort_by;
}
// query params
if (is_array($id)) {
$id = ObjectSerializer::serializeCollection($id, '', true);
}
if ($id !== null) {
$queryParams['id'] = $id;
}
// query params
if (is_array($cloud_connector_id)) {
$cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);
}
if ($cloud_connector_id !== null) {
$queryParams['cloud_connector_id'] = $cloud_connector_id;
}
// query params
if (is_array($name)) {
$name = ObjectSerializer::serializeCollection($name, '', true);
}
if ($name !== null) {
$queryParams['name'] = $name;
}
// query params
if (is_array($location)) {
$location = ObjectSerializer::serializeCollection($location, '', true);
}
if ($location !== null) {
$queryParams['location'] = $location;
}
// query params
if (is_array($price)) {
$price = ObjectSerializer::serializeCollection($price, '', true);
}
if ($price !== null) {
$queryParams['price'] = $price;
}
// path params
if ($pool_id !== null) {
$resourcePath = str_replace(
'{' . 'pool_id' . '}',
ObjectSerializer::toPathValue($pool_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function search2i($bucket, $index, $queryType = 0, $key = null, $rangeMin = null, $rangeMax = null) \n {\n $req = new $this->_classMap[self::MSG_CODE_INDEX_REQ]();\n $req->setBucket($bucket);\n $req->setIndex($index);\n $req->setQtype($queryType);\n if ($key) {\n $req->setKey($key);\n }\n if ($rangeMin) {\n $req->setRangeMin($rangeMin);\n }\n if ($rangeMax) {\n $req->setRangeMax($rangeMax);\n }\n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_INDEX_REQ));\n list($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_INDEX_RESP) {\n if ($response->hasKeys()) {\n return $response->getKeysList();\n } else {\n return array();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer message code: \" . $messageCode);\n }\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"private function indexBuckets($buckets, $indexBy)\n {\n $result = [];\n foreach ($buckets as $key => $models) {\n $result[$key] = [];\n foreach ($models as $model) {\n $index = is_string($indexBy) ? $model[$indexBy] : call_user_func($indexBy, $model);\n $result[$key][$index] = $model;\n }\n }\n\n return $result;\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function getBucket($name, $type = null) {}",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"function POOL_createExtendedPackageIndex($poolName)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t/**if (file_exists(\"/m23/tmp/makePoolPackages.sh\"))\n\t\treturn(false);*/\n\t\t\n\tif (SERVER_runningInBackground(\"m23poolBuilder\"))\n\t\treturn(false);\n\n\t$poolDir=POOL_getDir($poolName);\n\t\n\t//set correct permissions, remove old log file and copy m23 packages\n\texec(\"sudo chmod 755 $poolDir -R\n\trm -f /m23/tmp/makePoolPackages.log\n\tsudo rm -f -r $poolDir/pool/main/m23\n\tcp /mdk/m23Debs/debs $poolDir/pool/main/m23 -r 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\");\n\n\t//open the pool builder script file, executing this file will produce the necessary Packages files\n\t/**$pbfile=fopen(\"/m23/tmp/makePoolPackages.sh\",\"w\");*/\n\n\t$serverIP=getServerIP();\n\t//write sources list for this pool\n\t$sourceslist=\"#mirror: http://$serverIP/pool/$poolName\\n\";\n\n\t//write BASH header and set the user to the Apache user after the script start\n\t$cmds=\"\n\techo \\\"$I18N_packageIndexCreationStarted\\\" 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\";\n\n\t//get the releases (woody, sarge, sid)\n\t$pin = popen(\"cd $poolDir\t\n\tfind dists/ -type d -maxdepth 2 | cut -d'/' -f2 | sort -u\",\"r\");\n\twhile ($release = fgets($pin))\n\t{\n\t\t$release=trim($release);\n\t\tif (empty($release))\n\t\t\tcontinue;\n\t\t\n\t\t//all branches seperated by a blank\n\t\t$branches=\"\";\n\n\t\t//get the branches for a release (main, contrib, ...)\n\t\t$pin2 = popen(\"cd $poolDir\n\t\tfind dists/$release/ -type d -maxdepth 2 | cut -d'/' -f3 | sort -u\",\"r\");\n\t\twhile ($branch = fgets($pin2))\n\t\t{\n\t\t\t$branch=trim($branch);\n\t\t\tif (empty($branch))\n\t\t\t\tcontinue;\n\n\t\t\t$branches.=\"$branch \";\n\n\t\t\t//directory that stores the Debian packages\n\t\t\t$debDir=\"pool/$branch\";\n\t\t\t//directory that will store Packages*\n\t\t\t$listDir=\"dists/$release/$branch/binary-i386\";\n\n\t\t\t//write the script for one release + branch\n\t\t\t$cmds.=\"cd $poolDir\n\t\t\tfor from in `find | grep '%'`\n\t\t\tdo\n\t\t\t\tto=`echo \\$from | sed 's/%3a/./g'`\n\t\t\t\tmv -f \\$from \\$to\n\t\t\tdone\n\t\t\trm tempmkpackages -f\n\t\t\ttouch tempmkpackages 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\t\tmkdir -p $listDir\n\t\t\tchmod 755 $listDir\n\t\t\trm $listDir/Packages.bz2 -f 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\t\tdpkg-scanpackages $debDir tempmkpackages | grep -v \\\"Depends: $\\\" > $listDir/Packages 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\t\tgzip -c $listDir/Packages > $listDir/Packages.gz 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\t\tbzip2 -k $listDir/Packages 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\t\t\trm tempmkpackages -f\n\t\t\t\";\n\t\t};\n\n\t\t//write sources.list entry for this release and with all braches\n\t\t$sourceslist.=\"deb http://$serverIP/pool/$poolName/ $release $branches\\n\";\n\n\t\tpclose($pin2);\n\t};\n\n\tpclose($pin);\n\n\t//delete the script after execution\n\t$cmds.=\"\n\techo \\\"$I18N_packageIndexCreationFinished\\\" 2>&1 | tee -a /m23/tmp/makePoolPackages.log\n\trm -f /m23/tmp/makePoolPackages.sh\\n\";\n\n\tPOOL_setProperty($poolName,\"sourceslist\",$sourceslist);\n\n\t/**\n\t//execute the script in a screen. screen is started as \"root\", but the script is executed as the Apache user\n\texec(\"chmod +x /m23/tmp/makePoolPackages.sh\n\tsudo screen -dmS m23poolBuilder su \".HELPER_getApacheUser().\" -c /m23/tmp/makePoolPackages.sh\");\n\t*/\n\n\tSERVER_runInBackground(\"m23poolBuilder\",$cmds,HELPER_getApacheUser(),true);\n}",
"protected function indexFilesByPoolRequest($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($file_id)) {\n $file_id = ObjectSerializer::serializeCollection($file_id, '', true);\n }\n if ($file_id !== null) {\n $queryParams['file_id'] = $file_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($permission)) {\n $permission = ObjectSerializer::serializeCollection($permission, '', true);\n }\n if ($permission !== null) {\n $queryParams['permission'] = $permission;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n // query params\n if (is_array($change_date)) {\n $change_date = ObjectSerializer::serializeCollection($change_date, '', true);\n }\n if ($change_date !== null) {\n $queryParams['change_date'] = $change_date;\n }\n // query params\n if (is_array($modification_date)) {\n $modification_date = ObjectSerializer::serializeCollection($modification_date, '', true);\n }\n if ($modification_date !== null) {\n $queryParams['modification_date'] = $modification_date;\n }\n // query params\n if (is_array($access_date)) {\n $access_date = ObjectSerializer::serializeCollection($access_date, '', true);\n }\n if ($access_date !== null) {\n $queryParams['access_date'] = $access_date;\n }\n // query params\n if (is_array($gid)) {\n $gid = ObjectSerializer::serializeCollection($gid, '', true);\n }\n if ($gid !== null) {\n $queryParams['gid'] = $gid;\n }\n // query params\n if (is_array($uid)) {\n $uid = ObjectSerializer::serializeCollection($uid, '', true);\n }\n if ($uid !== null) {\n $queryParams['uid'] = $uid;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"static function searchBucketsByBucketName($bucketName,$database)\n\t{\n\t\t\n\t\t$sql = \"SELECT * from BUCKET where BUCKET_NAME = '{$bucketName}'\";\n\t\t$res = $database->query($sql);\n\t\treturn $res;\n\t}",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"protected function indexOnTapesFilesByPoolRequest($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexOnTapesFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/on_tapes_files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function listBuckets();",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"abstract public function info($bucket, $name);",
"public function tags($bucket, $tags, $limit = 100, $offset = 0, $withScores = 0, $order = 'desc', $type = 'inter', $cb)\n {\n \n $redis = Redis::connection('redisDB');\n $ns = $this->prefix.':'.$bucket;\n $prefix = $ns.':TAGS:';\n # The last element to get\n $lastElement = $offset + $limit - 1;\n \n $cTags = count($tags);\n if ($cTags == 0) {\n $cb(null, [\n 'total_items_result' => 0,\n 'total_items_db' => 0,\n 'items' => [],\n 'tags' => $tags,\n 'limit' => $limit,\n 'offset' => $offset,\n 'withScores' => $withScores,\n 'order' => $order,\n 'type' => $type,\n ]);\n \n return;\n }\n else {\n if ($cTags > 1) {\n $randKey = $ns.str_random(10).'_'.Carbon::now()->micro;\n $keys = [];\n foreach ($tags as $tag) {\n array_push($keys, $prefix.$tag);\n }\n try {\n if (strcmp($type, self::CONST_TYPE_INTER) == 0) {\n $redis->zInter($randKey, $keys, null, 'MIN');\n }\n else {\n $redis->zUnion($randKey, $keys, null, 'MIN');\n }\n } catch (Exception $e) {\n $cb($e, [\n 'msg' => 'Error!',\n ]);\n \n return;\n }\n $resultkey = $randKey;\n }\n else {\n if ($cTags == 1) {\n $resultkey = $prefix.$tags[0];\n }\n }\n }\n \n try {\n $total_items_db = $redis->zCount($resultkey, '-inf', '+inf');\n if (strcmp($order, self::CONST_ORDER_DESC) == 0) {\n $tagsresult = $redis->zRevRange($resultkey, $offset, $lastElement, $withScores);\n }\n else {\n $tagsresult = $redis->zRange($resultkey, $offset, $lastElement, $withScores);\n }\n } catch (Exception $e) {\n $total_items_db = 0;\n $cb($e, [\n 'msg' => 'Error!',\n ]);\n \n return;\n }\n \n if ($cTags > 1) {\n $redis->delete($resultkey);\n }\n \n $result = [];\n \n if ($withScores) {\n foreach ($tagsresult as $id => $score) {\n $temp = [\n 'bucket' => $bucket,\n 'id' => $id,\n 'score' => $score,\n \n ];\n array_push($result, $temp);\n }\n }\n else {\n foreach ($tagsresult as $id) {\n $temp = [\n 'bucket' => $bucket,\n 'id' => $id,\n 'score' => 0,\n ];\n array_push($result, $temp);\n }\n }\n $cb(null, [\n 'total_items_result' => count($tagsresult),\n 'total_items_db' => $total_items_db,\n 'items' => $result,\n 'tags' => $tags,\n 'limit' => $limit,\n 'offset' => $offset,\n 'withScores' => $withScores,\n 'order' => $order,\n 'type' => $type,\n ]);\n }"
] | [
"0.66131145",
"0.6369683",
"0.6253613",
"0.6230065",
"0.5989705",
"0.5626825",
"0.535365",
"0.5335649",
"0.5243708",
"0.5206927",
"0.50865936",
"0.5031744",
"0.4998769",
"0.49473614",
"0.4914309",
"0.49039134",
"0.4885629",
"0.48706847",
"0.4826617",
"0.4794947",
"0.47518742",
"0.4745044",
"0.47345984",
"0.4644636",
"0.46318442",
"0.46235278",
"0.45924422",
"0.45920515",
"0.45736676",
"0.4563259"
] | 0.67578095 | 0 |
Operation mountStatusCloudBucketAsync Get mount status of Cloud bucket. | public function mountStatusCloudBucketAsync($cloud_bucket_id)
{
return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getSyncStatus(){\n $command = new Command($this->host, self::LOADER_GET_SYNC,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function get_queue_status() {\n\t\t$queue = $this->get_queue();\n\t\t$pending = count( $queue['pending'] );\n\t\t$done = count( $queue['done'] );\n\t\t$processing = count( $queue['processing'] );\n\t\t$error = count( $queue['error'] );\n\t\t$total = $done + $pending + $processing + $error;\n\t\t$completed = $done;\n\t\t$file = null;\n\t\tif ( ! empty( $queue['processing'][0] ) ) {\n\t\t\t$file = get_attached_file( $queue['processing'][0] );\n\t\t}\n\t\t$percent = 100;\n\t\tif ( $completed < $total ) {\n\t\t\t$percent = round( ( $completed + $error ) / ( $total ) * 100, 1 );\n\t\t}\n\n\t\t$return = array(\n\t\t\t'total' => $total,\n\t\t\t'processing' => $processing,\n\t\t\t'current_file' => $file ? basename( $file ) : null,\n\t\t\t'pending' => $pending + $processing,\n\t\t\t'done' => $completed,\n\t\t\t'error' => $queue['error'],\n\t\t\t'percent' => $percent,\n\t\t);\n\t\tif ( ! empty( $queue['started'] ) ) {\n\t\t\t$return['started'] = $queue['started'];\n\t\t}\n\n\t\t// Auto Stop.\n\t\tif ( 100 === $return['percent'] ) {\n\t\t\t$this->stop_queue();\n\t\t}\n\n\t\treturn $return;\n\t}",
"public static function get_status()\n\t{\n\t\t// Base the status on directory writability\n\t\t$status = self::get_folder_status();\n\t\t$ret = $status['temporary'] && $status['output'];\n\n\t\t// Scan for high severity quirks\n\t\t$quirks = self::get_quirks();\n\t\tif(!empty($quirks))\n\t\t{\n\t\t\tforeach($quirks as $quirk)\n\t\t\t{\n\t\t\t\tif($quirk['severity'] == 'critical') $ret = false;\n\t\t\t}\n\t\t}\n\n\t\t// Return status\n\t\treturn $ret;\n\t}",
"public static function get_folder_status()\n\t{\n\t\tstatic $status = null;\n\n\t\tif(is_null($status))\n\t\t{\n\t\t\t$stock_dirs = AEPlatform::get_stock_directories();\n\n\t\t\t// Get output writable status\n\t\t\t$registry =& AEFactory::getConfiguration();\n\t\t\t$outdir = $registry->get('akeeba.basic.output_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$outdir = str_replace($macro, $replacement, $outdir);\n\t\t\t}\n\t\t\t$status['output']= @is_writable($outdir);\n\n\t\t\t// Get temp writable status\n\t\t\t$tempdir = $registry->get('akeeba.basic.temporary_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$tempdir = str_replace($macro, $replacement, $tempdir);\n\t\t\t}\n\t\t\t$status['temporary'] = @is_writable($tempdir);\n\t\t}\n\n\t\treturn $status;\n\t}",
"public function status($mailbox) {\n return @imap_status($this->conn, $mailbox, SA_ALL);\n }",
"public function GetUploadMassContactsStatus(GetUploadMassContactsStatus $parameters)\n {\n return $this->__soapCall('GetUploadMassContactsStatus', array($parameters));\n }",
"public function getStatus(): string\n {\n return $this->fileStatus;\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getStorageBytesStatus()\n {\n return isset($this->storage_bytes_status) ? $this->storage_bytes_status : '';\n }",
"public function get() {\n\t\t$documentStatus = $this->decorateDocumentStatus($this->storageBackend->get());\n\t\treturn $documentStatus;\n\t}",
"public function getLoadingStatus(){\n $command = new Command($this->host, self::LOADER_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function stream_stat()\n {\n $this->initBuffer($this->_path);\n $stat = array();\n $stat[0] = $stat['dev'] = is_resource($this->_curlHandle) ? intval($this->_curlHandle) : 0;\n $stat[1] = $stat['ino'] = null;\n $stat[2] = $stat['mode'] = $this->_mode;\n $stat[3] = $stat['nlink'] = 1;\n $stat[4] = $stat['uid'] = getmyuid();\n $stat[5] = $stat['gid'] = getmygid();\n $stat[6] = $stat['rdev'] = null;\n $stat[7] = $stat['size'] = strlen($this->_buffer);\n $stat[8] = $stat['atime'] = $this->_bufferAccessTime;\n $stat[9] = $stat['mtime'] = $this->_bufferModifyTime;\n $stat[10] = $stat['ctime'] = $this->_bufferModifyTime; // the cURL buffer is modified/created at the same operations because it is immutable\n $stat[11] = $stat['blksize'] = null; // not supported for this data\n $stat[12] = $stat['blocks'] = null; // not supported for this data\n return $stat;\n }",
"public function stat($path) {\n\t\treturn $this->storage->stat($path);\n\t}",
"public function getMounts();",
"public function getStatus()\n\t{\n\t\treturn $this->oImapFolder->GetExtended('STATUS');\n\t}",
"public function getLockStatus();",
"public function status(): InputStream\n {\n return $this->executor->executeAsync('git -C ' . $this->path . ' status');\n }",
"public function getStatistics() {\n\t\tif ($this->getData() === FALSE)\n\t\t\treturn FALSE;\n\t\t// Get the mount point of the filesystem.\n\t\tif (FALSE === ($mountPoint = $this->getMountPoint()))\n\t\t\treturn FALSE;\n\t\t$cmd = sprintf('df -PTtzfs %s', escapeshellarg($mountPoint));\n\t\t$output = [];\n\t\t@OMVUtil::exec($cmd, $output, $result);\n\t\tif ($result !== 0 || count($output) != 2) {\n\t\t\t$this->setLastError($output);\n\t\t\treturn FALSE;\n\t\t}\n\t\t$matches = preg_split(\"/[\\s,]+/\", $output[1]);\n\t\tif (0 !== strcasecmp($mountPoint, $matches[6]))\n\t\t\tcontinue;\n\t\t$result = array(\n\t\t\t\t\"devicefile\" => $this->deviceFile,\n\t\t\t\t\"type\" => $matches[1],\n\t\t\t\t\"blocks\" => $matches[2],\n\t\t\t\t\"size\" => bcmul($matches[2], \"1024\", 0),\n\t\t\t\t\"used\" => binary_convert($matches[3], \"KiB\", \"B\"),\n\t\t\t\t\"available\" => binary_convert($matches[4], \"KiB\", \"B\"),\n\t\t\t\t\"percentage\" => intval(trim($matches[5], \"%\")),\n\t\t\t\t\"mountpoint\" => $matches[6]\n\t\t\t );\n\t\treturn $result;\n\t}",
"public function status() {\n\t\t$status = array(\n\t\t\t'status' => 'stopped',\n\t\t);\n\t\tif ( file_exists( CRNMSR_PATH . 'includes/runner' ) ) {\n\t\t\t$file = fopen( CRNMSR_PATH . 'includes/runner', \"r\" );\n\t\t\t$content = fread( $file, filesize( CRNMSR_PATH . 'includes/runner' ) );\n\t\t\tfclose( $file );\n\t\t\t$data = json_decode( $content, ARRAY_A );\n\t\t\t$status = array_merge( $status, $data );\n\t\t\t$status['started'] = date( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $data['timestamp'] );\n\t\t\t$status['status_time'] = human_time_diff( $data['timestamp'], current_time( 'timestamp' ) );\n\t\t\t$status['status_diff'] = current_time( 'timestamp' ) - $data['timestamp'];\n\t\t}\n\n\t\treturn $status;\n\t}",
"public function getStatus(){\n $command = new Command($this->host, self::BLOCKS_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n\n return [\n \"height\" => $command->getData(\"height\"),\n \"fee\" => $this->convertAmountToFloat($command->getData(\"fee\")),\n \"milestone\" => $command->getData(\"milestone\"),\n \"reward\" => $this->convertAmountToFloat($command->getData(\"reward\")),\n \"supply\" => $this->convertAmountToFloat($command->getData(\"supply\"))\n ];\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getStatus() {\n return $this->fetch('status');\n }",
"public function stat() {\n $result = fstat($this->handle);\n return $result;\n }"
] | [
"0.593687",
"0.5467022",
"0.51635295",
"0.46318364",
"0.45766157",
"0.4540954",
"0.4485112",
"0.4193793",
"0.41819802",
"0.41732502",
"0.41686633",
"0.4156991",
"0.41474292",
"0.41275877",
"0.40596166",
"0.40367517",
"0.3961943",
"0.3961165",
"0.39470074",
"0.39227137",
"0.39215106",
"0.38956273",
"0.3882627",
"0.38758639",
"0.3863935",
"0.38240054",
"0.38119727",
"0.3804115",
"0.37942553",
"0.37660757"
] | 0.6061557 | 0 |
Operation mountStatusCloudBucketAsyncWithHttpInfo Get mount status of Cloud bucket. | public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\MountStatus';
$request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getIfcStructureAsyncWithHttpInfo($cloud_pk, $id, $project_pk)\n {\n $returnType = '';\n $request = $this->getIfcStructureRequest($cloud_pk, $id, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function deleteSystemAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $uuid)\n {\n $returnType = '';\n $request = $this->deleteSystemRequest($cloud_pk, $ifc_pk, $project_pk, $uuid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }",
"public function getSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Space';\n $request = $this->getSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function deleteSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $returnType = '';\n $request = $this->deleteSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function fontsGetFileStorageInfoAsyncWithHttpInfo($tenant_id = null)\n {\n $returnType = '\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto';\n $request = $this->fontsGetFileStorageInfoRequest($tenant_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getZonesAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $color = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Zone[]';\n $request = $this->getZonesRequest($cloud_pk, $ifc_pk, $project_pk, $color);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ZoneSpace';\n $request = $this->getZoneSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getCurrentVHostStatisticsAsyncWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\CurrentVHostStatistics';\n $request = $this->getCurrentVHostStatisticsRequest($server_name, $vhost_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.656212",
"0.58615047",
"0.5638884",
"0.5572962",
"0.48305792",
"0.47229615",
"0.4721147",
"0.45986617",
"0.45906126",
"0.45274884",
"0.4373196",
"0.43700528",
"0.4287635",
"0.42022854",
"0.41631934",
"0.41454926",
"0.4138968",
"0.40229556",
"0.39960104",
"0.39563403",
"0.39010656",
"0.38549903",
"0.38536423",
"0.3830724",
"0.38217553",
"0.38020253",
"0.37881672",
"0.37644103",
"0.37489212",
"0.372961"
] | 0.69511926 | 0 |
Create request for operation 'mountStatusCloudBucket' | protected function mountStatusCloudBucketRequest($cloud_bucket_id)
{
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'
);
}
$resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createVolume($request);",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"function stream_bucket_new ($stream, $buffer) {}",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreateBucket()\n {\n $client= new S3Client(\n [\n 'credentials' => [\n 'key' => 'AKIAIOSFODNN7EXAMPLE',\n 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'\n ],\n 'region' => $this->bucket_region,\n 'version' => 'latest',\n\n 'endpoint' => $this->end_point,\n 'scheme' => 'http',\n //'bucket_endpoint' => true, //<= This may not be required. Because this is used for CNAME type bucket.\n ]\n );\n //end create S3 client\n\n //start create bucket\n $client->createBucket(\n [\n 'ACL' => 'private',\n 'Bucket' => $this->bucket_name,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->bucket_region,\n ],\n ]\n );\n //end create bucket\n\n return $client;\n }",
"public function __construct($_deleteBucketResponse = NULL)\r\n\t{\r\n\t\tparent::__construct(array('DeleteBucketResponse'=>$_deleteBucketResponse));\r\n\t}",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function getBucket($name, $type = null) {}",
"public function testBucketOperations()\n {\n $bucketName = \"test-bucket-operations\";\n //not created, should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n //create bucket\n $this->client->createBucket($bucketName);\n //created, should be true\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertTrue($exist);\n //should be in the bucket list\n $exist = false;\n $response = $this->client->listBuckets();\n foreach ($response->buckets as $bucket) {\n if ($bucket->name == $bucketName) {\n $exist = true;\n }\n }\n $this->assertTrue($exist);\n //delete\n $this->client->deleteBucket($bucketName);\n //deleted should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucket(string $bucket){\n $client = $this->buildClient();\n $result = [\"status\"=>false];\n try {\n $result = $client->createBucket([\n 'Bucket' => $bucket,\n ]);\n $result[\"status\"] = true;\n } catch (AwsException $e) {\n $result[\"error\"] = $e->getAwsErrorMessage();\n }\n return $result;\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function store(BucketStoreRequest $request)\n {\n $bucket = Bucket::create($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was created');\n\n return redirect('/buckets');\n }",
"public function upload() {\n\t\t// 'step' => 'list',\n\t\t// 'continue_from' => ''\n\t\t// );\n\t\t$response = &$this->request->post ['last'];\n\t\t\n\t\t$valid_extensions = $this->get_valid_extensions ( array (\n\t\t\t\t'css' => getNitroPersistence ( 'CDNRackspace.SyncCSS' ),\n\t\t\t\t'js' => getNitroPersistence ( 'CDNRackspace.SyncJavaScript' ),\n\t\t\t\t'images' => getNitroPersistence ( 'CDNRackspace.SyncImages' ) \n\t\t) );\n\t\t\n\t\tif (empty ( $valid_extensions )) {\n\t\t\tthrow new Exception ( \"No file types selected for upload.\" );\n\t\t}\n\t\t\n\t\t$files = $this->cdn_prepare_files ( array (\n\t\t\t\t'valid_extensions' => $valid_extensions,\n\t\t\t\t'cdn' => '2' \n\t\t) );\n\t\t\n\t\tif (! empty ( $files ) && $response ['step'] == 'upload') {\n\t\t\trequire_once (NITRO_LIB_FOLDER . 'rackspace/php-opencloud.php');\n\t\t\t\n\t\t\tif (phpversion () >= '5.3.0') {\n\t\t\t\trequire_once NITRO_INCLUDE_FOLDER . 'rackspace_init.php';\n\t\t\t} else {\n\t\t\t\tthrow new Exception ( \"Your PHP version is \" . phpversion () . '. Rackspace CDN can be used on PHP 5.3.0+' );\n\t\t\t}\n\t\t\t\n\t\t\t$data = array (\n\t\t\t\t\t'rackspace' => &$objstore \n\t\t\t);\n\t\t\t\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$data ['file'] = $file;\n\t\t\t\t$this->rackspace_upload_file ( $data );\n\t\t\t\t$this->cdn_after_upload ( $file );\n\t\t\t}\n\t\t} else if (empty ( $files ) && $response ['step'] == 'upload') {\n\t\t\t$persistence = getNitroPersistence ();\n\t\t\t$persistence ['Nitro'] ['CDNRackspace'] ['LastUpload'] = date ( $this->language->get ( 'date_format_long' ) . ' ' . $this->language->get ( 'time_format' ) );\n\t\t\tsetNitroPersistence ( $persistence );\n\t\t}\n\t}",
"function makeFolder($name, $parentID, $token, $type, $domainID) {\r\n\t$ch = curl_init();\r\n\r\n\tcurl_setopt($ch, CURLOPT_URL, 'https://api.broadsign.com:10889/rest/container/v9/add');\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, \r\n\t\"{ \r\n\t\t\\\"container_id\\\": \".$parentID.\", \r\n\t\t\\\"domain_id\\\": \".$domainID .\", \r\n\t\t\\\"group_id\\\": $type, \r\n\t\t\\\"name\\\": \\\"\".$name.\"\\\",\r\n\t\t\\\"parent_id\\\": 0,\r\n\t\t\\\"parent_resource_type\\\": \\\"container\\\"\r\n\t}\");\r\n\r\n\t$headers = array();\r\n\t$headers[] = 'Accept: application/json';\r\n\t$headers[] = 'Authorization: Bearer '.$token;\r\n\t$headers[] = 'Content-Type: application/json';\r\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\r\n\t$result = curl_exec($ch);\r\n\tif (curl_errno($ch)) {\r\n\t\techo 'Error:' . curl_error($ch);\r\n\t}\r\n\tcurl_close($ch);\r\n\treturn $result;\r\n\t\t\r\n}",
"public function attachVolume($request);",
"public function store(Request $request)\n {\n $this->ensureEnvironmentVariablesAreAvailable($request);\n\n Gate::authorize('uploadFiles', [\n $request->user(),\n $bucket = $request->input('bucket') ?: $_ENV['AWS_BUCKET'],\n ]);\n\n $client = $this->storageClient();\n\n $uuid = (string) Str::uuid();\n\n $expiresAfter = config('vapor.signed_storage_url_expires_after', 5);\n\n $signedRequest = $client->createPresignedRequest(\n $this->createCommand($request, $client, $bucket, $key = $this->getKey($uuid)),\n sprintf('+%s minutes', $expiresAfter)\n );\n\n $uri = $signedRequest->getUri();\n\n return response()->json([\n 'uuid' => $uuid,\n 'bucket' => $bucket,\n 'key' => $key,\n 'url' => $uri->getScheme().'://'.$uri->getAuthority().$uri->getPath().'?'.$uri->getQuery(),\n 'headers' => $this->headers($request, $signedRequest),\n ], 201);\n }",
"public function url_stat($uri, $flags) {\n if ($uri == NULL) {\n $uri = $this->uri;\n }\n if (variable_get('rackspace_cloud_debug')) {\n watchdog(\"cloud_files\", \"Checking file status (url_stat) %file\", array('%file' => $uri), WATCHDOG_DEBUG);\n }\n\n $return = FALSE; // Default to fail.\n $mode = 0;\n\n $this->uri = $uri;\n $target = $this->getLocalPath($uri);\n\n if (!isset($this->object)) {\n if (!isset($this->container)) {\n $this->getContainer();\n }\n }\n\n //check if the file exists\n $objexists = TRUE;\n try{\n if (!empty($target)) {\n $this->object = $this->container->get_object($target);\n }\n } catch (NoSuchObjectException $e) {\n //$file = $cont->create_object($target);\n $objexists = FALSE;\n }\n\n if ($objexists) {\n //if the target is empty, its the root of the container (counts as a directory)\n if (empty($target) || $this->object->content_type == \"application/directory\") {\n $mode = 0040000; // S_IFDIR means it's a directory.\n }\n else {\n $mode = 0100000; // S_IFREG, means it's a file.\n }\n if ($mode) {\n $size = 0;\n if ($mode == 0100000) {\n $size = $this->object->content_length;\n }\n\n $mode |= 0777;\n $return = array(\n 'dev' => 0,\n 'ino' => 0,\n 'mode' => $mode,\n 'nlink' => 0,\n 'uid' => 0,\n 'gid' => 0,\n 'rdev' => 0,\n 'size' => $size,\n 'atime' => 0,\n 'mtime' => 0,\n 'ctime' => 0,\n 'blksize' => 0,\n 'blocks' => 0,\n );\n }\n }\n\n return $return;\n }",
"public function describeVolumes($request);",
"function initRequest($verb, $resource, $contentType, $acl, $metadata, $extraHttpHeaders)\r\n {\r\n $date_rfc822 = \"D, d M Y H:i:s T\";\r\n $httpDate = gmdate($date_rfc822);\r\n \r\n $this->request->setMethod($verb);\r\n $this->request->addHeader(\"content-type\", $contentType);\r\n $this->request->addHeader(\"Date\", $httpDate);\r\n $this->request->addHeader(\"x-amz-acl\", $acl);\r\n \t\t\r\n // add metadata\r\n $metadatastring = \"\";\r\n if (is_array($metadata)) \r\n {\r\n ksort($metadata);\r\n\t\t\tforeach ($metadata as $key => $value) \r\n {\r\n\t\t\t\t$this->request->addHeader(\"x-amz-meta-\".$key, trim($value));\r\n\t\t\t\t$metadatastring .= \"x-amz-meta-\".$key.\":\".trim($value).\"\\n\";\r\n }\r\n }\r\n \r\n // add extra http headers\r\n if (is_array($extraHttpHeaders)) \r\n {\r\n\t\t\tforeach ($extraHttpHeaders as $key => $value) \r\n {\r\n\t\t\t\t$this->request->addHeader($key, trim($value));\r\n }\r\n }\r\n \r\n // auth\r\n $stringToSign = \"$verb\\n\\n$contentType\\n$httpDate\\nx-amz-acl:$acl\\n$metadatastring/$resource\";\r\n\t\t$hasher =& new Crypt_HMAC($this->secretKey, \"sha1\");\r\n\t\t$signature = $this->hex2b64($hasher->hash($stringToSign));\r\n\r\n $this->request->addHeader(\"Authorization\", \"AWS \" . $this->accessKeyId . \":\" . $signature);\r\n\t}",
"public function createSnapshot($request);",
"public function system() : DiskSystemContract;",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function query(Query $query):Bucket;",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public function drivesAllRequest($raw = false, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $cursor = null, $limit = 20, $filter = null, $fields = null)\n {\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling FileStorageApi.drivesAll, must be smaller than or equal to 200.');\n }\n if ($limit !== null && $limit < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling FileStorageApi.drivesAll, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/file-storage/drives';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($raw !== null) {\n if('form' === 'form' && is_array($raw)) {\n foreach($raw as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['raw'] = $raw;\n }\n }\n // query params\n if ($cursor !== null) {\n if('form' === 'form' && is_array($cursor)) {\n foreach($cursor as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['cursor'] = $cursor;\n }\n }\n // query params\n if ($limit !== null) {\n if('form' === 'form' && is_array($limit)) {\n foreach($limit as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['limit'] = $limit;\n }\n }\n // query params\n if ($filter !== null) {\n if('form' === 'deepObject' && is_array($filter)) {\n foreach($filter as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['filter'] = $filter;\n }\n }\n // query params\n if ($fields !== null) {\n if('form' === 'form' && is_array($fields)) {\n foreach($fields as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['fields'] = $fields;\n }\n }\n\n // header params\n if ($x_apideck_consumer_id !== null) {\n $headerParams['x-apideck-consumer-id'] = ObjectSerializer::toHeaderValue($x_apideck_consumer_id);\n }\n // header params\n if ($x_apideck_app_id !== null) {\n $headerParams['x-apideck-app-id'] = ObjectSerializer::toHeaderValue($x_apideck_app_id);\n }\n // header params\n if ($x_apideck_service_id !== null) {\n $headerParams['x-apideck-service-id'] = ObjectSerializer::toHeaderValue($x_apideck_service_id);\n }\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = $this->config->getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }"
] | [
"0.61615807",
"0.5918615",
"0.5448402",
"0.5364825",
"0.48285094",
"0.47471145",
"0.47177482",
"0.46166494",
"0.4574747",
"0.45672473",
"0.45259404",
"0.44878873",
"0.44754976",
"0.44295514",
"0.44123137",
"0.44064218",
"0.43732798",
"0.43731147",
"0.43637568",
"0.43609238",
"0.43602064",
"0.43325797",
"0.43205097",
"0.43098432",
"0.42962667",
"0.4287997",
"0.4269726",
"0.42597386",
"0.4257873",
"0.42529324"
] | 0.71710324 | 0 |
Operation mountStatusCloudBucketByCloudConnectorAsync Get mount status of Cloud bucket. | public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)
{
return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getSyncStatus(){\n $command = new Command($this->host, self::LOADER_GET_SYNC,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function getStatus()\n {\n if (array_key_exists(\"status\", $this->_propDict)) {\n if (is_a($this->_propDict[\"status\"], \"\\Microsoft\\Graph\\Model\\DeviceManagementExchangeConnectorStatus\") || is_null($this->_propDict[\"status\"])) {\n return $this->_propDict[\"status\"];\n } else {\n $this->_propDict[\"status\"] = new DeviceManagementExchangeConnectorStatus($this->_propDict[\"status\"]);\n return $this->_propDict[\"status\"];\n }\n }\n return null;\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function get_queue_status() {\n\t\t$queue = $this->get_queue();\n\t\t$pending = count( $queue['pending'] );\n\t\t$done = count( $queue['done'] );\n\t\t$processing = count( $queue['processing'] );\n\t\t$error = count( $queue['error'] );\n\t\t$total = $done + $pending + $processing + $error;\n\t\t$completed = $done;\n\t\t$file = null;\n\t\tif ( ! empty( $queue['processing'][0] ) ) {\n\t\t\t$file = get_attached_file( $queue['processing'][0] );\n\t\t}\n\t\t$percent = 100;\n\t\tif ( $completed < $total ) {\n\t\t\t$percent = round( ( $completed + $error ) / ( $total ) * 100, 1 );\n\t\t}\n\n\t\t$return = array(\n\t\t\t'total' => $total,\n\t\t\t'processing' => $processing,\n\t\t\t'current_file' => $file ? basename( $file ) : null,\n\t\t\t'pending' => $pending + $processing,\n\t\t\t'done' => $completed,\n\t\t\t'error' => $queue['error'],\n\t\t\t'percent' => $percent,\n\t\t);\n\t\tif ( ! empty( $queue['started'] ) ) {\n\t\t\t$return['started'] = $queue['started'];\n\t\t}\n\n\t\t// Auto Stop.\n\t\tif ( 100 === $return['percent'] ) {\n\t\t\t$this->stop_queue();\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function status($mailbox) {\n return @imap_status($this->conn, $mailbox, SA_ALL);\n }",
"public function GetUploadMassContactsStatus(GetUploadMassContactsStatus $parameters)\n {\n return $this->__soapCall('GetUploadMassContactsStatus', array($parameters));\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public static function get_folder_status()\n\t{\n\t\tstatic $status = null;\n\n\t\tif(is_null($status))\n\t\t{\n\t\t\t$stock_dirs = AEPlatform::get_stock_directories();\n\n\t\t\t// Get output writable status\n\t\t\t$registry =& AEFactory::getConfiguration();\n\t\t\t$outdir = $registry->get('akeeba.basic.output_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$outdir = str_replace($macro, $replacement, $outdir);\n\t\t\t}\n\t\t\t$status['output']= @is_writable($outdir);\n\n\t\t\t// Get temp writable status\n\t\t\t$tempdir = $registry->get('akeeba.basic.temporary_directory');\n\t\t\tforeach( $stock_dirs as $macro => $replacement )\n\t\t\t{\n\t\t\t\t$tempdir = str_replace($macro, $replacement, $tempdir);\n\t\t\t}\n\t\t\t$status['temporary'] = @is_writable($tempdir);\n\t\t}\n\n\t\treturn $status;\n\t}",
"public function status(): InputStream\n {\n return $this->executor->executeAsync('git -C ' . $this->path . ' status');\n }",
"public function getLoadingStatus(){\n $command = new Command($this->host, self::LOADER_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function stream_stat()\n {\n $this->initBuffer($this->_path);\n $stat = array();\n $stat[0] = $stat['dev'] = is_resource($this->_curlHandle) ? intval($this->_curlHandle) : 0;\n $stat[1] = $stat['ino'] = null;\n $stat[2] = $stat['mode'] = $this->_mode;\n $stat[3] = $stat['nlink'] = 1;\n $stat[4] = $stat['uid'] = getmyuid();\n $stat[5] = $stat['gid'] = getmygid();\n $stat[6] = $stat['rdev'] = null;\n $stat[7] = $stat['size'] = strlen($this->_buffer);\n $stat[8] = $stat['atime'] = $this->_bufferAccessTime;\n $stat[9] = $stat['mtime'] = $this->_bufferModifyTime;\n $stat[10] = $stat['ctime'] = $this->_bufferModifyTime; // the cURL buffer is modified/created at the same operations because it is immutable\n $stat[11] = $stat['blksize'] = null; // not supported for this data\n $stat[12] = $stat['blocks'] = null; // not supported for this data\n return $stat;\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getStatus(): string\n {\n return $this->fileStatus;\n }",
"public function diagnostics()\n {\n $utilityObj = new Utility;\n $diagnostics = array();\n $aclCheck = $this->fs->get_bucket_acl($this->bucket);\n if((int)$aclCheck->status == 200)\n {\n $storageSize = $this->fs->get_bucket_filesize($this->bucket, true);\n $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Connection to bucket \"%s\" is okay.', $this->bucket));\n $diagnostics[] = $utilityObj->diagnosticLine(true, sprintf('Total space used in bucket \"%s\" is %s.', $this->bucket, $storageSize));\n }\n else\n {\n $diagnostics[] = $utilityObj->diagnosticLine(false, sprintf('Connection to bucket \"%s\" is NOT okay.', $this->bucket));\n }\n return $diagnostics;\n }",
"public function getStatus()\n\t{\n\t\treturn $this->oImapFolder->GetExtended('STATUS');\n\t}",
"public static function get_status()\n\t{\n\t\t// Base the status on directory writability\n\t\t$status = self::get_folder_status();\n\t\t$ret = $status['temporary'] && $status['output'];\n\n\t\t// Scan for high severity quirks\n\t\t$quirks = self::get_quirks();\n\t\tif(!empty($quirks))\n\t\t{\n\t\t\tforeach($quirks as $quirk)\n\t\t\t{\n\t\t\t\tif($quirk['severity'] == 'critical') $ret = false;\n\t\t\t}\n\t\t}\n\n\t\t// Return status\n\t\treturn $ret;\n\t}",
"public function listMailBoxesWithStatus()\n {\n $status = [];\n foreach ($this->listMailBoxConnectionStrings() as $mailBoxName) {\n $imapStatus = imap_status($this->ressource, $mailBoxName, SA_ALL);\n $status[] = $mailBoxStatus = new MailBoxStatus;\n $mailBoxStatus->name = $this->nameFromConnectionString($mailBoxName);\n $mailBoxStatus->base64Name = base64_encode($mailBoxStatus->name);\n $mailBoxStatus->flags = $imapStatus->flags;\n $mailBoxStatus->recent = $imapStatus->recent;\n $mailBoxStatus->unseen = $imapStatus->unseen;\n $mailBoxStatus->messages = $imapStatus->messages;\n $mailBoxStatus->uniqueIdValidity = $imapStatus->uidvalidity;\n $mailBoxStatus->uniqueIdNext = $imapStatus->uidnext;\n }\n\n return $status;\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function status() {\n\t\t$status = array(\n\t\t\t'status' => 'stopped',\n\t\t);\n\t\tif ( file_exists( CRNMSR_PATH . 'includes/runner' ) ) {\n\t\t\t$file = fopen( CRNMSR_PATH . 'includes/runner', \"r\" );\n\t\t\t$content = fread( $file, filesize( CRNMSR_PATH . 'includes/runner' ) );\n\t\t\tfclose( $file );\n\t\t\t$data = json_decode( $content, ARRAY_A );\n\t\t\t$status = array_merge( $status, $data );\n\t\t\t$status['started'] = date( get_option( 'date_format' ) . ' @ ' . get_option( 'time_format' ), $data['timestamp'] );\n\t\t\t$status['status_time'] = human_time_diff( $data['timestamp'], current_time( 'timestamp' ) );\n\t\t\t$status['status_diff'] = current_time( 'timestamp' ) - $data['timestamp'];\n\t\t}\n\n\t\treturn $status;\n\t}",
"public function getStatus(){\n $command = new Command($this->host, self::BLOCKS_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n\n return [\n \"height\" => $command->getData(\"height\"),\n \"fee\" => $this->convertAmountToFloat($command->getData(\"fee\")),\n \"milestone\" => $command->getData(\"milestone\"),\n \"reward\" => $this->convertAmountToFloat($command->getData(\"reward\")),\n \"supply\" => $this->convertAmountToFloat($command->getData(\"supply\"))\n ];\n }"
] | [
"0.5745175",
"0.5556509",
"0.5536399",
"0.4928145",
"0.4781206",
"0.44722584",
"0.43957683",
"0.43495005",
"0.42731056",
"0.4235966",
"0.4229644",
"0.4136677",
"0.4078129",
"0.40648884",
"0.40533006",
"0.40455335",
"0.40315396",
"0.40288618",
"0.40264672",
"0.3945517",
"0.39442316",
"0.38956556",
"0.38739517",
"0.38693586",
"0.38608965",
"0.38595688",
"0.38567516",
"0.38487577",
"0.38316357",
"0.38152656"
] | 0.6086632 | 0 |
Operation mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo Get mount status of Cloud bucket. | public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\MountStatus';
$request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getCurrentVHostStatisticsAsyncWithHttpInfo($server_name, $vhost_name)\n {\n $returnType = '\\Swagger\\Client\\Model\\CurrentVHostStatistics';\n $request = $this->getCurrentVHostStatisticsRequest($server_name, $vhost_name);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getZonesAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $color = null)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Zone[]';\n $request = $this->getZonesRequest($cloud_pk, $ifc_pk, $project_pk, $color);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }"
] | [
"0.6131032",
"0.58899295",
"0.5181943",
"0.51613694",
"0.5060837",
"0.5010984",
"0.49606434",
"0.48788324",
"0.47928086",
"0.46848896",
"0.45910442",
"0.4567498",
"0.45551455",
"0.45158765",
"0.43848595",
"0.42776105",
"0.42665184",
"0.42234525",
"0.41030613",
"0.4080066",
"0.40320167",
"0.40152842",
"0.3952628",
"0.38376385",
"0.37858418",
"0.37757862",
"0.37262395",
"0.36611077",
"0.36575127",
"0.3646965"
] | 0.6708125 | 0 |
Create request for operation 'mountStatusCloudBucketByCloudConnector' | protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createVolume($request);",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function stream_bucket_new ($stream, $buffer) {}",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getBucket($name, $type = null) {}",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreateBucket()\n {\n $client= new S3Client(\n [\n 'credentials' => [\n 'key' => 'AKIAIOSFODNN7EXAMPLE',\n 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'\n ],\n 'region' => $this->bucket_region,\n 'version' => 'latest',\n\n 'endpoint' => $this->end_point,\n 'scheme' => 'http',\n //'bucket_endpoint' => true, //<= This may not be required. Because this is used for CNAME type bucket.\n ]\n );\n //end create S3 client\n\n //start create bucket\n $client->createBucket(\n [\n 'ACL' => 'private',\n 'Bucket' => $this->bucket_name,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->bucket_region,\n ],\n ]\n );\n //end create bucket\n\n return $client;\n }",
"final protected function makeConnector()\n\t{\n\t\t$config = $this->getEngineConfiguration();\n\n\t\t// Get the configuration parameters\n\t\t$accessKey = $config['accessKey'];\n\t\t$secretKey = $config['secretKey'];\n\t\t$useSSL = $config['useSSL'];\n\t\t$customEndpoint = $config['customEndpoint'];\n\t\t$signatureMethod = $config['signatureMethod'];\n\t\t$region = $config['region'];\n\t\t$useLegacyPathAccess = $config['useLegacyPathAccess'];\n\t\t$disableMultipart = $config['disableMultipart'];\n\t\t$bucket = $config['bucket'];\n\n\t\tif ($signatureMethod == 's3')\n\t\t{\n\t\t\t$signatureMethod = 'v2';\n\t\t}\n\n\t\tFactory::getLog()->debug(sprintf(\n\t\t\t\"%s -- Using signature method %s, %s uploads\",\n\t\t\t$this->engineLogName, $signatureMethod, $disableMultipart ? 'single-part' : 'multipart'\n\t\t));\n\n\t\t// Makes sure the custom endpoint has no protocol and no trailing slash\n\t\t$customEndpoint = trim($customEndpoint);\n\n\t\tif (!empty($customEndpoint))\n\t\t{\n\t\t\t$protoPos = strpos($customEndpoint, ':\\\\');\n\n\t\t\tif ($protoPos !== false)\n\t\t\t{\n\t\t\t\t$customEndpoint = substr($customEndpoint, $protoPos + 3);\n\t\t\t}\n\n\t\t\t$customEndpoint = rtrim($customEndpoint, '/');\n\n\t\t\tFactory::getLog()->debug(sprintf(\n\t\t\t\t\"%s -- Using custom endpoint %s\", $this->engineLogName, $customEndpoint\n\t\t\t));\n\t\t}\n\n\t\t// Remove any slashes from the bucket\n\t\t$bucket = str_replace('/', '', $bucket);\n\n\t\t// Sanity checks\n\t\tif (!function_exists('curl_init'))\n\t\t{\n\t\t\tthrow new BadConfiguration('cURL is not enabled, please enable it in order to post-process your archives');\n\t\t}\n\n\t\tif (empty($accessKey))\n\t\t{\n\t\t\tthrow new BadConfiguration(sprintf(\"You have not set up your %s Access Key\", $this->engineLogName));\n\t\t}\n\n\t\tif (empty($secretKey))\n\t\t{\n\t\t\tthrow new BadConfiguration(sprintf(\"You have not set up your %s Secret Key\", $this->engineLogName));\n\t\t}\n\n\t\tif (empty($bucket))\n\t\t{\n\t\t\tthrow new BadConfiguration(sprintf(\"You have not set up your %s Bucket\", $this->engineLogName));\n\t\t}\n\n\t\t// Prepare the configuration\n\t\t$configuration = new Configuration($accessKey, $secretKey, $signatureMethod, $region);\n\t\t$configuration->setSSL($useSSL);\n\n\t\tif (!empty($config['token']))\n\t\t{\n\t\t\t$configuration->setToken($config['token']);\n\t\t}\n\n\t\tif ($customEndpoint)\n\t\t{\n\t\t\t$configuration->setEndpoint($customEndpoint);\n\t\t}\n\n\t\t// Set path-style vs virtual hosting style access\n\t\t$configuration->setUseLegacyPathStyle($useLegacyPathAccess);\n\n\t\t// Return the new S3 client instance\n\t\treturn new Connector($configuration);\n\t}",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function upload() {\n\t\t// 'step' => 'list',\n\t\t// 'continue_from' => ''\n\t\t// );\n\t\t$response = &$this->request->post ['last'];\n\t\t\n\t\t$valid_extensions = $this->get_valid_extensions ( array (\n\t\t\t\t'css' => getNitroPersistence ( 'CDNRackspace.SyncCSS' ),\n\t\t\t\t'js' => getNitroPersistence ( 'CDNRackspace.SyncJavaScript' ),\n\t\t\t\t'images' => getNitroPersistence ( 'CDNRackspace.SyncImages' ) \n\t\t) );\n\t\t\n\t\tif (empty ( $valid_extensions )) {\n\t\t\tthrow new Exception ( \"No file types selected for upload.\" );\n\t\t}\n\t\t\n\t\t$files = $this->cdn_prepare_files ( array (\n\t\t\t\t'valid_extensions' => $valid_extensions,\n\t\t\t\t'cdn' => '2' \n\t\t) );\n\t\t\n\t\tif (! empty ( $files ) && $response ['step'] == 'upload') {\n\t\t\trequire_once (NITRO_LIB_FOLDER . 'rackspace/php-opencloud.php');\n\t\t\t\n\t\t\tif (phpversion () >= '5.3.0') {\n\t\t\t\trequire_once NITRO_INCLUDE_FOLDER . 'rackspace_init.php';\n\t\t\t} else {\n\t\t\t\tthrow new Exception ( \"Your PHP version is \" . phpversion () . '. Rackspace CDN can be used on PHP 5.3.0+' );\n\t\t\t}\n\t\t\t\n\t\t\t$data = array (\n\t\t\t\t\t'rackspace' => &$objstore \n\t\t\t);\n\t\t\t\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$data ['file'] = $file;\n\t\t\t\t$this->rackspace_upload_file ( $data );\n\t\t\t\t$this->cdn_after_upload ( $file );\n\t\t\t}\n\t\t} else if (empty ( $files ) && $response ['step'] == 'upload') {\n\t\t\t$persistence = getNitroPersistence ();\n\t\t\t$persistence ['Nitro'] ['CDNRackspace'] ['LastUpload'] = date ( $this->language->get ( 'date_format_long' ) . ' ' . $this->language->get ( 'time_format' ) );\n\t\t\tsetNitroPersistence ( $persistence );\n\t\t}\n\t}",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testBucketOperations()\n {\n $bucketName = \"test-bucket-operations\";\n //not created, should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n //create bucket\n $this->client->createBucket($bucketName);\n //created, should be true\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertTrue($exist);\n //should be in the bucket list\n $exist = false;\n $response = $this->client->listBuckets();\n foreach ($response->buckets as $bucket) {\n if ($bucket->name == $bucketName) {\n $exist = true;\n }\n }\n $this->assertTrue($exist);\n //delete\n $this->client->deleteBucket($bucketName);\n //deleted should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n }",
"public function __construct($_deleteBucketResponse = NULL)\r\n\t{\r\n\t\tparent::__construct(array('DeleteBucketResponse'=>$_deleteBucketResponse));\r\n\t}",
"public function createBucket(string $bucket){\n $client = $this->buildClient();\n $result = [\"status\"=>false];\n try {\n $result = $client->createBucket([\n 'Bucket' => $bucket,\n ]);\n $result[\"status\"] = true;\n } catch (AwsException $e) {\n $result[\"error\"] = $e->getAwsErrorMessage();\n }\n return $result;\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function drivesAllRequest($raw = false, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $cursor = null, $limit = 20, $filter = null, $fields = null)\n {\n if ($limit !== null && $limit > 200) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling FileStorageApi.drivesAll, must be smaller than or equal to 200.');\n }\n if ($limit !== null && $limit < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$limit\" when calling FileStorageApi.drivesAll, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/file-storage/drives';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($raw !== null) {\n if('form' === 'form' && is_array($raw)) {\n foreach($raw as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['raw'] = $raw;\n }\n }\n // query params\n if ($cursor !== null) {\n if('form' === 'form' && is_array($cursor)) {\n foreach($cursor as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['cursor'] = $cursor;\n }\n }\n // query params\n if ($limit !== null) {\n if('form' === 'form' && is_array($limit)) {\n foreach($limit as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['limit'] = $limit;\n }\n }\n // query params\n if ($filter !== null) {\n if('form' === 'deepObject' && is_array($filter)) {\n foreach($filter as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['filter'] = $filter;\n }\n }\n // query params\n if ($fields !== null) {\n if('form' === 'form' && is_array($fields)) {\n foreach($fields as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['fields'] = $fields;\n }\n }\n\n // header params\n if ($x_apideck_consumer_id !== null) {\n $headerParams['x-apideck-consumer-id'] = ObjectSerializer::toHeaderValue($x_apideck_consumer_id);\n }\n // header params\n if ($x_apideck_app_id !== null) {\n $headerParams['x-apideck-app-id'] = ObjectSerializer::toHeaderValue($x_apideck_app_id);\n }\n // header params\n if ($x_apideck_service_id !== null) {\n $headerParams['x-apideck-service-id'] = ObjectSerializer::toHeaderValue($x_apideck_service_id);\n }\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = $this->config->getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function store(BucketStoreRequest $request)\n {\n $bucket = Bucket::create($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was created');\n\n return redirect('/buckets');\n }"
] | [
"0.6926461",
"0.5752068",
"0.5302889",
"0.4948112",
"0.4873629",
"0.4694965",
"0.46447068",
"0.46127674",
"0.4539894",
"0.45335472",
"0.4526981",
"0.4503292",
"0.42914042",
"0.42722437",
"0.42468697",
"0.42380565",
"0.4236966",
"0.42362618",
"0.42314145",
"0.42301178",
"0.42238557",
"0.41599903",
"0.4141023",
"0.40823096",
"0.4069594",
"0.4067974",
"0.40556797",
"0.40274075",
"0.402378",
"0.40089357"
] | 0.69804585 | 0 |
Operation mountStatusCloudBucketByPoolAsync Get mount status of Cloud bucket. | public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)
{
return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getSyncStatus(){\n $command = new Command($this->host, self::LOADER_GET_SYNC,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function getTransactionPoolStatus()\r\n {\r\n return $this->getBlockChainSdkObj()->getTransactionPoolStatus();\r\n }",
"public function getLoadingStatus(){\n $command = new Command($this->host, self::LOADER_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getLockStatus();",
"public function getPhysicalConnectionServiceStatus($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->getPhysicalConnectionServiceStatusWithOptions($request, $runtime);\n }",
"public function getStatus(){\n $command = new Command($this->host, self::BLOCKS_GET_STATUS,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n $command->execute();\n\n return [\n \"height\" => $command->getData(\"height\"),\n \"fee\" => $this->convertAmountToFloat($command->getData(\"fee\")),\n \"milestone\" => $command->getData(\"milestone\"),\n \"reward\" => $this->convertAmountToFloat($command->getData(\"reward\")),\n \"supply\" => $this->convertAmountToFloat($command->getData(\"supply\"))\n ];\n }",
"public function get_queue_status() {\n\t\t$queue = $this->get_queue();\n\t\t$pending = count( $queue['pending'] );\n\t\t$done = count( $queue['done'] );\n\t\t$processing = count( $queue['processing'] );\n\t\t$error = count( $queue['error'] );\n\t\t$total = $done + $pending + $processing + $error;\n\t\t$completed = $done;\n\t\t$file = null;\n\t\tif ( ! empty( $queue['processing'][0] ) ) {\n\t\t\t$file = get_attached_file( $queue['processing'][0] );\n\t\t}\n\t\t$percent = 100;\n\t\tif ( $completed < $total ) {\n\t\t\t$percent = round( ( $completed + $error ) / ( $total ) * 100, 1 );\n\t\t}\n\n\t\t$return = array(\n\t\t\t'total' => $total,\n\t\t\t'processing' => $processing,\n\t\t\t'current_file' => $file ? basename( $file ) : null,\n\t\t\t'pending' => $pending + $processing,\n\t\t\t'done' => $completed,\n\t\t\t'error' => $queue['error'],\n\t\t\t'percent' => $percent,\n\t\t);\n\t\tif ( ! empty( $queue['started'] ) ) {\n\t\t\t$return['started'] = $queue['started'];\n\t\t}\n\n\t\t// Auto Stop.\n\t\tif ( 100 === $return['percent'] ) {\n\t\t\t$this->stop_queue();\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function status($mailbox) {\n return @imap_status($this->conn, $mailbox, SA_ALL);\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"final public function getStatus()\n {\n return @shm_has_var(self::$shmId, 11511697116117115)\n ? shm_get_var(self::$shmId, 11511697116117115)\n : 'PENDING';\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getIfcsAsync($cloud_pk, $project_pk, $status = null, $source = null)\n {\n return $this->getIfcsAsyncWithHttpInfo($cloud_pk, $project_pk, $status, $source)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function get_status() {\r\n try {\r\n\r\n $db = $this->app->getDbo();\r\n\r\n $gd_status = $this->gd_model->get_status();\r\n\r\n $ret = array (\r\n 'gds' => $gd_status,\r\n );\r\n\r\n $this->renderJson($ret);\r\n\r\n } catch (Exception $ex) {\r\n $this->app->write_log('pd_get_status_exception - ' . $ex->getMessage());\r\n \r\n $ret = $this->message(1, 'pd_get_status_exception', $ex->getMessage());\r\n $this->renderJson($ret);\r\n }\r\n }",
"public function status(): InputStream\n {\n return $this->executor->executeAsync('git -C ' . $this->path . ' status');\n }",
"public function getStorageBytesStatus()\n {\n return isset($this->storage_bytes_status) ? $this->storage_bytes_status : '';\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"function swoole_get_vm_status() {}",
"public function GetUploadMassContactsStatus(GetUploadMassContactsStatus $parameters)\n {\n return $this->__soapCall('GetUploadMassContactsStatus', array($parameters));\n }",
"public function getStatus() {\n return $this->fetch('status');\n }",
"public function getStatus () {\n\n print('[govi-boxes] ' . $this->containerName . ': ' . $this->containerStatus . PHP_EOL);\n }",
"public function listMailBoxesWithStatus()\n {\n $status = [];\n foreach ($this->listMailBoxConnectionStrings() as $mailBoxName) {\n $imapStatus = imap_status($this->ressource, $mailBoxName, SA_ALL);\n $status[] = $mailBoxStatus = new MailBoxStatus;\n $mailBoxStatus->name = $this->nameFromConnectionString($mailBoxName);\n $mailBoxStatus->base64Name = base64_encode($mailBoxStatus->name);\n $mailBoxStatus->flags = $imapStatus->flags;\n $mailBoxStatus->recent = $imapStatus->recent;\n $mailBoxStatus->unseen = $imapStatus->unseen;\n $mailBoxStatus->messages = $imapStatus->messages;\n $mailBoxStatus->uniqueIdValidity = $imapStatus->uidvalidity;\n $mailBoxStatus->uniqueIdNext = $imapStatus->uidnext;\n }\n\n return $status;\n }"
] | [
"0.5723381",
"0.5395097",
"0.48646227",
"0.46834165",
"0.4630551",
"0.4521106",
"0.44365764",
"0.44178247",
"0.44102335",
"0.4396856",
"0.39909157",
"0.39763463",
"0.39598104",
"0.3959103",
"0.39464816",
"0.3906387",
"0.39022124",
"0.38990194",
"0.3893859",
"0.3861209",
"0.38554788",
"0.38031048",
"0.379806",
"0.37897366",
"0.3780103",
"0.37708324",
"0.37369174",
"0.37135342",
"0.37071437",
"0.36965984"
] | 0.5638313 | 1 |
Operation mountStatusCloudBucketByPoolAsyncWithHttpInfo Get mount status of Cloud bucket. | public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\MountStatus';
$request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexImportFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexOnTapesFilesByPoolAsync($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n return $this->indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $name, $type, $size)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexTapesByFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\TapeCollection';\n $request = $this->indexTapesByFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexImportFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexImportFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexImportFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexImportFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\ImportFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ImportFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ImportFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexFilesByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\NodeumFileCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\NodeumFileCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\NodeumFileCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listIpsAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'ip_address');\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(IpAddressListResponse::class);\n });\n }",
"public function importFilesChildrenByPoolAsyncWithHttpInfo($pool_id, $file_parent_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ImportFileCollection';\n $request = $this->importFilesChildrenByPoolRequest($pool_id, $file_parent_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function onTapesFilesChildrenByPoolAsyncWithHttpInfo($pool_id, $file_parent_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $request = $this->onTapesFilesChildrenByPoolRequest($pool_id, $file_parent_id, $limit, $offset, $name, $type, $size);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.5894115",
"0.56013674",
"0.5567612",
"0.5453777",
"0.5225022",
"0.51630163",
"0.5078618",
"0.5050496",
"0.5038666",
"0.50310856",
"0.5014587",
"0.48083186",
"0.46874395",
"0.464364",
"0.45889238",
"0.44551444",
"0.44121248",
"0.4408493",
"0.43918443",
"0.43484917",
"0.43375376",
"0.42975092",
"0.42709902",
"0.42704847",
"0.42432526",
"0.41984785",
"0.41980818",
"0.41798204",
"0.41777876",
"0.41653657"
] | 0.68579644 | 0 |
Create request for operation 'mountStatusCloudBucketByPool' | protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)
{
// verify the required parameter 'pool_id' is set
if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'
);
}
$resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($pool_id !== null) {
$resourcePath = str_replace(
'{' . 'pool_id' . '}',
ObjectSerializer::toPathValue($pool_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createVolume($request);",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexImportFilesByPoolRequest($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexImportFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/import_files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($file_id)) {\n $file_id = ObjectSerializer::serializeCollection($file_id, '', true);\n }\n if ($file_id !== null) {\n $queryParams['file_id'] = $file_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($permission)) {\n $permission = ObjectSerializer::serializeCollection($permission, '', true);\n }\n if ($permission !== null) {\n $queryParams['permission'] = $permission;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n // query params\n if (is_array($change_date)) {\n $change_date = ObjectSerializer::serializeCollection($change_date, '', true);\n }\n if ($change_date !== null) {\n $queryParams['change_date'] = $change_date;\n }\n // query params\n if (is_array($modification_date)) {\n $modification_date = ObjectSerializer::serializeCollection($modification_date, '', true);\n }\n if ($modification_date !== null) {\n $queryParams['modification_date'] = $modification_date;\n }\n // query params\n if (is_array($access_date)) {\n $access_date = ObjectSerializer::serializeCollection($access_date, '', true);\n }\n if ($access_date !== null) {\n $queryParams['access_date'] = $access_date;\n }\n // query params\n if (is_array($gid)) {\n $gid = ObjectSerializer::serializeCollection($gid, '', true);\n }\n if ($gid !== null) {\n $queryParams['gid'] = $gid;\n }\n // query params\n if (is_array($uid)) {\n $uid = ObjectSerializer::serializeCollection($uid, '', true);\n }\n if ($uid !== null) {\n $queryParams['uid'] = $uid;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexFilesByPoolRequest($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($file_id)) {\n $file_id = ObjectSerializer::serializeCollection($file_id, '', true);\n }\n if ($file_id !== null) {\n $queryParams['file_id'] = $file_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($permission)) {\n $permission = ObjectSerializer::serializeCollection($permission, '', true);\n }\n if ($permission !== null) {\n $queryParams['permission'] = $permission;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n // query params\n if (is_array($change_date)) {\n $change_date = ObjectSerializer::serializeCollection($change_date, '', true);\n }\n if ($change_date !== null) {\n $queryParams['change_date'] = $change_date;\n }\n // query params\n if (is_array($modification_date)) {\n $modification_date = ObjectSerializer::serializeCollection($modification_date, '', true);\n }\n if ($modification_date !== null) {\n $queryParams['modification_date'] = $modification_date;\n }\n // query params\n if (is_array($access_date)) {\n $access_date = ObjectSerializer::serializeCollection($access_date, '', true);\n }\n if ($access_date !== null) {\n $queryParams['access_date'] = $access_date;\n }\n // query params\n if (is_array($gid)) {\n $gid = ObjectSerializer::serializeCollection($gid, '', true);\n }\n if ($gid !== null) {\n $queryParams['gid'] = $gid;\n }\n // query params\n if (is_array($uid)) {\n $uid = ObjectSerializer::serializeCollection($uid, '', true);\n }\n if ($uid !== null) {\n $queryParams['uid'] = $uid;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexOnTapesFilesByPoolRequest($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexOnTapesFilesByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/on_tapes_files';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($type)) {\n $type = ObjectSerializer::serializeCollection($type, '', true);\n }\n if ($type !== null) {\n $queryParams['type'] = $type;\n }\n // query params\n if (is_array($size)) {\n $size = ObjectSerializer::serializeCollection($size, '', true);\n }\n if ($size !== null) {\n $queryParams['size'] = $size;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listPoolServersRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling listPoolServers'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling listPoolServers'\n );\n }\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/servers';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function getBucket($name, $type = null) {}",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"public function newpool(Request $request)\n {\n $attributes = request()->validate([\n 'pool_name' => ['required', 'min:3']\n ]);\n \n TalentPool::create($attributes + ['employer_id' => Auth::guard('employer')->user()->id]);\n \n return redirect('/talentpool');\n }",
"public function requestLiquidityPool(string $poolId) : LiquidityPoolResponse {\n return $this->liquidityPools()->forPoolId($poolId);\n }",
"function stream_bucket_new ($stream, $buffer) {}",
"public function store(Request $request)\n {\n // -- define required parameters\n $rules = [\n 'name' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'region_id' => 'required',\n 'cover' => 'image|max:1000',\n ];\n // -- Validate and display error messages\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return JSON::response(true, 'Error occured', $validator->errors()->all(), 400);\n }\n $data = $request->only(['name', 'region_id', 'description', 'cover', 'latitude', 'longitude', 'open_time', 'close_time']);\n if ($request->file('cover')) {\n $file = $request->file('cover');\n $extension = $file->guessClientExtension();\n // Create unique name\n $fileName = time() . uniqid() . '.' . $extension;\n // upload image to the branches folder in the uploads driver\n ImageMaker::upload($file, 'branches', $fileName);\n // change the cover value\n $data['cover'] = $fileName;\n }\n // finally we create new branch\n $branch = Branch::create($data);\n return JSON::response(false, 'New branch is created!', $branch, 200);\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"function POOL_readCD($poolName,$mountPoint)\n{\n\texec(\"\n\tcd \".POOL_getDir($poolName).\"\n\tmkdir archivs\n\tsudo umount $mountPoint\n\tsudo mount $mountPoint\n\t\");\n\n\tPOOL_getCDDistributionRelease($mountPoint,$distr,$release);\n\tPOOL_prepare($poolName,$release,$distr,POOL_getProperty($poolName,\"arch\"));\n\n\t$addCmds=\"\n\tsudo eject $mountPoint\n\tsudo umount $mountPoint\n\t\";\n\n\tPOOL_makeRepository($poolName, $mountPoint,$addCmds);\n}",
"public function attachVolume($request);",
"protected function showFileByPoolRequest($pool_id, $file_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showFileByPool'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null || (is_array($file_id) && count($file_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling showFileByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/files/{file_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'file_id' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createPoolServerRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n $weight = array_key_exists('weight', $options) ? $options['weight'] : 100;\n $max_conn = array_key_exists('max_conn', $options) ? $options['max_conn'] : 0;\n $port = array_key_exists('port', $options) ? $options['port'] : 80;\n $address = array_key_exists('address', $options) ? $options['address'] : null;\n $comment = array_key_exists('comment', $options) ? $options['comment'] : null;\n $disabled = array_key_exists('disabled', $options) ? $options['disabled'] : false;\n $override_host = array_key_exists('override_host', $options) ? $options['override_host'] : 'null';\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling createPoolServer'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling createPoolServer'\n );\n }\n if ($weight !== null && $weight > 100) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.createPoolServer, must be smaller than or equal to 100.');\n }\n if ($weight !== null && $weight < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.createPoolServer, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/server';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // form params\n if ($weight !== null) {\n $formParams['weight'] = ObjectSerializer::toFormValue($weight);\n }\n // form params\n if ($max_conn !== null) {\n $formParams['max_conn'] = ObjectSerializer::toFormValue($max_conn);\n }\n // form params\n if ($port !== null) {\n $formParams['port'] = ObjectSerializer::toFormValue($port);\n }\n // form params\n if ($address !== null) {\n $formParams['address'] = ObjectSerializer::toFormValue($address);\n }\n // form params\n if ($comment !== null) {\n $formParams['comment'] = ObjectSerializer::toFormValue($comment);\n }\n // form params\n if ($disabled !== null) {\n $formParams['disabled'] = ObjectSerializer::toFormValue($disabled);\n }\n // form params\n if ($override_host !== null) {\n $formParams['override_host'] = ObjectSerializer::toFormValue($override_host);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createVpc($request);",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | [
"0.5838797",
"0.56322724",
"0.5415757",
"0.51169497",
"0.49037653",
"0.48936373",
"0.47447115",
"0.45920333",
"0.45682335",
"0.44758692",
"0.44726324",
"0.44367692",
"0.4356645",
"0.43197033",
"0.42480734",
"0.4245361",
"0.41757685",
"0.41482937",
"0.41295576",
"0.41001526",
"0.40749502",
"0.40427026",
"0.4010712",
"0.39999858",
"0.39763987",
"0.3964955",
"0.3949628",
"0.39487392",
"0.39485776",
"0.39476448"
] | 0.7385262 | 0 |
Operation showCloudBucketAsync Displays a specific cloud bucket. | public function showCloudBucketAsync($cloud_bucket_id)
{
return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function showAction( Brand $brand ) {\n\t\t\t$deleteForm = $this->createDeleteForm( $brand );\n\t\t\t\n\t\t\treturn $this->render(\n\t\t\t\t'sil21AdminBundle:Brand:show.html.twig', [\n\t\t\t\t\t'brand' => $brand,\n\t\t\t\t\t'delete_form' => $deleteForm->createView(),\n\t\t\t\t]\n\t\t\t);\n\t\t}",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Company $company, Branch $branch)\n {\n //\n }",
"public function show(brand $brand)\n {\n //\n }",
"public function show(Branch $branch)\n {\n return $this->respond($this->transformer->transform($branch));\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"abstract public function info($bucket, $name);",
"public function show($cod)\n {\n $bucket = 'just-cats-apenas';\n $object = $cod;\n\n try {\n $result = $this->s3->getObject([\n 'Bucket' => $bucket,\n 'Key' => $object\n ]);\n\n header(\"Content-Type: {$result['ContentType']}\");\n header('Content-Disposition: attachment; filename='.$object);\n echo $result['Body'];\n } catch (S3Exception $e) {\n return $e->getMessage() . PHP_EOL;\n }\n }",
"public function show(BlogCategory $blogCategory)\n {\n //\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function show(Cloud $storage, $id)\n\t{\n\t\t//\n\t\t$car = Car::find($id);\n\n\t\treturn view('cars.show')->with([ 'car' => $car, 'image_exists' => $storage->exists('images/' . $car->id . '.jpg') ]);\n\t}"
] | [
"0.6638435",
"0.6274542",
"0.56610256",
"0.54876155",
"0.5195665",
"0.50507694",
"0.49156266",
"0.49021506",
"0.47588396",
"0.47588396",
"0.47588396",
"0.47588396",
"0.47588396",
"0.47588396",
"0.47588396",
"0.47172725",
"0.4688919",
"0.4688919",
"0.4688919",
"0.4688919",
"0.4688919",
"0.46858808",
"0.46840417",
"0.45575187",
"0.45440713",
"0.4537514",
"0.4523106",
"0.44480747",
"0.44419727",
"0.4431212"
] | 0.6959722 | 0 |
Operation showCloudBucketAsyncWithHttpInfo Displays a specific cloud bucket. | public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->showCloudBucketRequest($cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"abstract public function info($bucket, $name);",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ZoneSpace';\n $request = $this->getZoneSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getIfcStructureAsyncWithHttpInfo($cloud_pk, $id, $project_pk)\n {\n $returnType = '';\n $request = $this->getIfcStructureRequest($cloud_pk, $id, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getIfcBVHAsyncWithHttpInfo($cloud_pk, $id, $project_pk)\n {\n $returnType = '';\n $request = $this->getIfcBVHRequest($cloud_pk, $id, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function getZoneAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Zone';\n $request = $this->getZoneRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Space';\n $request = $this->getSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"function s3_get_bucket($bucket, $more) {\n\t\t$url = s3_signed_object_url($bucket, '', array('params' => $more));\n\t\t$rsp = http_get($url);\n\t\treturn s3_parse_response($rsp);\n\t}",
"public function getCardReserveAccountDetailsUsingGetAsyncWithHttpInfo()\n {\n $returnType = '\\com\\hydrogen\\electron\\Model\\CardReserveAccountResponseVO';\n $request = $this->getCardReserveAccountDetailsUsingGetRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function fontsGetFileStorageInfoAsyncWithHttpInfo($tenant_id = null)\n {\n $returnType = '\\Aurigma\\AssetStorage\\Model\\FileStorageInfoDto';\n $request = $this->fontsGetFileStorageInfoRequest($tenant_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | [
"0.69122404",
"0.68744916",
"0.60294247",
"0.5853999",
"0.57049674",
"0.52504975",
"0.5175817",
"0.5040873",
"0.5006565",
"0.49278316",
"0.49246016",
"0.48907512",
"0.4823207",
"0.48120326",
"0.47064358",
"0.46764624",
"0.46546757",
"0.46266967",
"0.459842",
"0.4573484",
"0.44684544",
"0.44221157",
"0.4400374",
"0.43990162",
"0.4383897",
"0.43592194",
"0.43416542",
"0.43186483",
"0.43033367",
"0.4275862"
] | 0.7384757 | 0 |
Create request for operation 'showCloudBucket' | protected function showCloudBucketRequest($cloud_bucket_id)
{
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'
);
}
$resourcePath = '/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"abstract public function info($bucket, $name);",
"function s3_get_bucket($bucket, $more) {\n\t\t$url = s3_signed_object_url($bucket, '', array('params' => $more));\n\t\t$rsp = http_get($url);\n\t\treturn s3_parse_response($rsp);\n\t}",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getBucket($name, $type = null) {}",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public function testCreateBucket()\n {\n $client= new S3Client(\n [\n 'credentials' => [\n 'key' => 'AKIAIOSFODNN7EXAMPLE',\n 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'\n ],\n 'region' => $this->bucket_region,\n 'version' => 'latest',\n\n 'endpoint' => $this->end_point,\n 'scheme' => 'http',\n //'bucket_endpoint' => true, //<= This may not be required. Because this is used for CNAME type bucket.\n ]\n );\n //end create S3 client\n\n //start create bucket\n $client->createBucket(\n [\n 'ACL' => 'private',\n 'Bucket' => $this->bucket_name,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->bucket_region,\n ],\n ]\n );\n //end create bucket\n\n return $client;\n }",
"public static function bucketName();",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"public function getBucket()\n {\n return $this->bucket;\n }",
"public static function getS3Bucket() {\n\t\treturn SRA_Controller::getAppParams('bucket', 's3');\n\t}",
"public function getBucket()\n {\n return Mage::getStoreConfig('thai_s3/general/bucket');\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function query(Query $query):Bucket;",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function testBucketOperations()\n {\n $bucketName = \"test-bucket-operations\";\n //not created, should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n //create bucket\n $this->client->createBucket($bucketName);\n //created, should be true\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertTrue($exist);\n //should be in the bucket list\n $exist = false;\n $response = $this->client->listBuckets();\n foreach ($response->buckets as $bucket) {\n if ($bucket->name == $bucketName) {\n $exist = true;\n }\n }\n $this->assertTrue($exist);\n //delete\n $this->client->deleteBucket($bucketName);\n //deleted should be false\n $exist = $this->client->doesBucketExist($bucketName);\n $this->assertFalse($exist);\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create()\n {\n return view('buckets.create');\n }",
"function get_objects($bucket)\n{\n $objects = array();\n $storage = new StorageClient();\n $bucket = $storage->bucket($bucket);\n foreach ($bucket->objects() as $object) {\n $url = 'https://' . $bucket->name() . '.storage.googleapis.com/' . $object->name();\n $objInfo = array();\n $objInfo[\"name\"] = $object->name();\n $objInfo[\"url\"] = $url;\n array_push($objects, $objInfo);\n }\n return $objects;\n}",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"function getAllBucketObjects($client, $bucket, $prefix = '')\n{\n global $log;\n\n $objects = array();\n $next = '';\n\n do\n {\n// $log->debug(\"API Request.\");\n\n $result = $client->listObjects(array (\n 'Bucket' => $bucket,\n 'Marker' => urlencode($next),\n 'Prefix' => $prefix,\n ));\n\n if (!$result['Contents']) {\n break;\n }\n\n foreach ($result['Contents'] as $obj)\n {\n $objects[] = $obj;\n }\n\n $isTruncated = $result['IsTruncated'];\n\n if ($isTruncated) {\n $log->debug(\"is truncated\");\n $next = $objects[count($objects) - 1]['Key'];\n }\n\n } while ($isTruncated);\n\n// $log->debug(\"Reach End of function.\");\n\n return $objects;\n\n}",
"public function get_s3_bucket() {\n\t\treturn false;\n\t}",
"static function searchBucketsByBucketName($bucketName,$database)\n\t{\n\t\t\n\t\t$sql = \"SELECT * from BUCKET where BUCKET_NAME = '{$bucketName}'\";\n\t\t$res = $database->query($sql);\n\t\treturn $res;\n\t}",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }"
] | [
"0.63760984",
"0.62504405",
"0.62186295",
"0.6093493",
"0.60477984",
"0.6045032",
"0.5827572",
"0.5723491",
"0.57119",
"0.5630316",
"0.56249124",
"0.56046396",
"0.557424",
"0.55321366",
"0.5472778",
"0.54684055",
"0.54176956",
"0.5404365",
"0.5377175",
"0.53463405",
"0.5337729",
"0.52623326",
"0.5204863",
"0.51980066",
"0.51841545",
"0.51526195",
"0.51507896",
"0.5146653",
"0.51242745",
"0.5100801"
] | 0.6916959 | 0 |
Operation showCloudBucketByCloudConnectorAsync Displays a specific cloud bucket. | public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)
{
return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show(Company $company, Branch $branch)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function show(Brand $brand)\n {\n //\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show(Cloud $storage, $id)\n\t{\n\t\t//\n\t\t$car = Car::find($id);\n\n\t\treturn view('cars.show')->with([ 'car' => $car, 'image_exists' => $storage->exists('images/' . $car->id . '.jpg') ]);\n\t}",
"public function show(brand $brand)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"public function show(Branch $branch)\n {\n //\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function show(Curso $curso)\n {\n //\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function show(Scheme $scheme)\n {\n \treturn success($scheme);\n }"
] | [
"0.63585305",
"0.61232245",
"0.576841",
"0.5713768",
"0.5483706",
"0.48507616",
"0.47389615",
"0.45849144",
"0.4570099",
"0.4570099",
"0.4570099",
"0.4570099",
"0.4570099",
"0.4570099",
"0.4570099",
"0.4560786",
"0.44828784",
"0.4426419",
"0.4387191",
"0.4387191",
"0.4387191",
"0.4387191",
"0.4387191",
"0.43714777",
"0.43618694",
"0.43370795",
"0.43258217",
"0.43141794",
"0.43128458",
"0.42759153"
] | 0.63608146 | 0 |
Operation showCloudBucketByCloudConnectorAsyncWithHttpInfo Displays a specific cloud bucket. | public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"abstract public function info($bucket, $name);",
"public function show(Curso $curso)\n {\n //\n }",
"public function show(Info $info)\n {\n //\n }",
"public function show(Info $info)\n {\n //\n }",
"public function show(Curso $curso)\n {\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }"
] | [
"0.639334",
"0.5677249",
"0.5630997",
"0.5185672",
"0.5048852",
"0.49297923",
"0.48798615",
"0.4856633",
"0.47936496",
"0.47206196",
"0.46206018",
"0.46048495",
"0.45425487",
"0.45395973",
"0.45156422",
"0.45025042",
"0.44021133",
"0.43406487",
"0.4327834",
"0.42933542",
"0.41995662",
"0.4131232",
"0.40888044",
"0.40786937",
"0.39813653",
"0.39648062",
"0.39648062",
"0.39305323",
"0.3923185",
"0.38735738"
] | 0.6614476 | 0 |
Create request for operation 'showCloudBucketByCloudConnector' | protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getBucket($name, $type = null) {}",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function s3_get_bucket($bucket, $more) {\n\t\t$url = s3_signed_object_url($bucket, '', array('params' => $more));\n\t\t$rsp = http_get($url);\n\t\treturn s3_parse_response($rsp);\n\t}",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"abstract public function info($bucket, $name);",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public static function getS3Bucket() {\n\t\treturn SRA_Controller::getAppParams('bucket', 's3');\n\t}",
"public function getBucket()\n {\n return $this->bucket;\n }",
"public function testCreateBucket()\n {\n $client= new S3Client(\n [\n 'credentials' => [\n 'key' => 'AKIAIOSFODNN7EXAMPLE',\n 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'\n ],\n 'region' => $this->bucket_region,\n 'version' => 'latest',\n\n 'endpoint' => $this->end_point,\n 'scheme' => 'http',\n //'bucket_endpoint' => true, //<= This may not be required. Because this is used for CNAME type bucket.\n ]\n );\n //end create S3 client\n\n //start create bucket\n $client->createBucket(\n [\n 'ACL' => 'private',\n 'Bucket' => $this->bucket_name,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->bucket_region,\n ],\n ]\n );\n //end create bucket\n\n return $client;\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAvailableBuckets() {\n $credentials = $this->getCredentials();\n\n $client = Aws\\S3\\S3Client::factory(array(\n 'key' => $credentials['access'],\n 'secret' => $credentials['secret'],\n ));\n\n $data = $client->listBuckets();\n return $data['Buckets'];\n }",
"public function getBucket()\n {\n return Mage::getStoreConfig('thai_s3/general/bucket');\n }",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listBuckets();",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function index()\n {\n return view('bucket-list.index');\n }",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }"
] | [
"0.64327544",
"0.5811315",
"0.5610224",
"0.54992193",
"0.5445004",
"0.5437292",
"0.5338187",
"0.53039026",
"0.5301809",
"0.5286443",
"0.525092",
"0.5236299",
"0.52351606",
"0.5190485",
"0.518348",
"0.5157367",
"0.51106846",
"0.5071021",
"0.5048346",
"0.4961687",
"0.49322194",
"0.49129927",
"0.48870665",
"0.48864543",
"0.48798484",
"0.48502082",
"0.48202854",
"0.47419524",
"0.4735862",
"0.47340798"
] | 0.71806794 | 0 |
Operation showCloudBucketByPoolAsyncWithHttpInfo Displays a specific cloud bucket. | public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showFileByPoolAsync($pool_id, $file_id)\n {\n return $this->showFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileWithPath';\n $request = $this->showFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showOnTapeFileByPoolAsync($pool_id, $file_id)\n {\n return $this->showOnTapeFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getIfcBVHAsyncWithHttpInfo($cloud_pk, $id, $project_pk)\n {\n $returnType = '';\n $request = $this->getIfcBVHRequest($cloud_pk, $id, $project_pk);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showOnTapeFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFile';\n $request = $this->showOnTapeFileByPoolRequest($pool_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showFileByPool($pool_id, $file_id)\n {\n list($response) = $this->showFileByPoolWithHttpInfo($pool_id, $file_id);\n return $response;\n }",
"abstract public function info($bucket, $name);",
"public function showImportFileByPoolAsync($pool_id, $file_id)\n {\n return $this->showImportFileByPoolAsyncWithHttpInfo($pool_id, $file_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.6230644",
"0.5612526",
"0.5597988",
"0.54763806",
"0.5475694",
"0.5287168",
"0.52319527",
"0.49973673",
"0.4975813",
"0.4970413",
"0.49395987",
"0.49310338",
"0.49205187",
"0.47427294",
"0.47276774",
"0.46790144",
"0.4638078",
"0.4535991",
"0.45200068",
"0.4509914",
"0.43983468",
"0.4374831",
"0.43649048",
"0.43155864",
"0.43106815",
"0.42757633",
"0.41542116",
"0.40632463",
"0.40350652",
"0.40207925"
] | 0.67704517 | 0 |
Create request for operation 'showCloudBucketByPool' | protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)
{
// verify the required parameter 'pool_id' is set
if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $pool_id when calling showCloudBucketByPool'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'
);
}
$resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($pool_id !== null) {
$resourcePath = str_replace(
'{' . 'pool_id' . '}',
ObjectSerializer::toPathValue($pool_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getBucket($name, $type = null) {}",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"final public static function getPool(string $pool): array\n {\n return static::load()->pools[$pool] ?? [];\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"abstract public function info($bucket, $name);",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function pools()\n {\n return $this->get('/user/load_balancers/pools');\n }",
"public function create()\n {\n return view('buckets.create');\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"public function get($project, $region, $targetPool, $optParams = array())\n {\n $params = array('project' => $project, 'region' => $region, 'targetPool' => $targetPool);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Forminator_Google_Service_Compute_TargetPool\");\n }",
"function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('data_obj_Pools_pools',$k,$v); }",
"public function getPools()\n {\n return $this->get('/pools');\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"function s3_get_bucket($bucket, $more) {\n\t\t$url = s3_signed_object_url($bucket, '', array('params' => $more));\n\t\t$rsp = http_get($url);\n\t\treturn s3_parse_response($rsp);\n\t}",
"public function show(Bucket $bucket)\n {\n return view('buckets.show')->with('bucket', $bucket);\n }",
"public function getBucket($bucketName='', $password='')\n\t{\n\t\tif (!$bucketName)\n\t\t{\n\t\t\tif (!empty($this->bucketName))\n\t\t\t{\n\t\t\t\t$bucketName = $this->bucketName;\n\t\t\t\t$password = $this->bucketPassword;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tYii::log(\"Connection default bucket was not defined in couchbase config.\",CLogger::LEVEL_ERROR,'exception.InvalidConfigException');\n\t\t\t\tthrow new InvalidConfigException('Connection default bucket was not defined in couchbase config.');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->_buckets[$bucketName]))\n\t\t\treturn $this->_buckets[$bucketName];\n\n\t\ttry\n\t\t{\n\t\t\t$this->_buckets[$bucketName] = $this->_cluster->openBucket($bucketName, $password);\n\t\t}\n\t\tcatch(CouchbaseException $e)\n\t\t{\n\t\t\tYii::log($e->getMessage(),CLogger::LEVEL_ERROR,'exception.InvalidConfigException');\n\t\t\tthrow new InvalidConfigException('Connection failed to open the Couchbase bucket connection.'.$e->getMessage(),(int)$e->getCode());\n\t\t}\n\n\t\treturn $this->_buckets[$bucketName];\n\t}",
"public function index()\n {\n $buckets = QueryBuilder::for(Bucket::class)\n ->allowedFilters('name')\n ->defaultSort('name')\n ->allowedSorts('name')\n ->paginate(15);\n\n return view('buckets.index')->with('buckets', $buckets);\n }",
"public static function bucketName();",
"public function getBucket($bucket='all') {\n switch ($bucket) {\n case 'global':\n return $this->buckets['global'];\n break;\n case 'local':\n return $this->buckets['local'];\n break;\n default:\n return $this->buckets;\n break;\n }\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.609755",
"0.56816655",
"0.56070006",
"0.5538219",
"0.54797804",
"0.5423675",
"0.54121995",
"0.53795284",
"0.5239707",
"0.51441026",
"0.49931106",
"0.48999166",
"0.4889271",
"0.48831034",
"0.48571914",
"0.48362148",
"0.47737563",
"0.47349796",
"0.4728547",
"0.4719972",
"0.4685169",
"0.4654059",
"0.46364883",
"0.4619269",
"0.45843175",
"0.4553366",
"0.45525515",
"0.4526079",
"0.44876426",
"0.44857588"
] | 0.7457642 | 0 |
Operation syncCloudBuckets Synchronize internal cloud buckets with their remote equivalent. | public function syncCloudBuckets($cloud_connector_id)
{
list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function syncSharedFolders()\n\t{\n\t\t$shared = (array) $this->rocketeer->getOption('remote.shared');\n\t\tforeach ($shared as $file) {\n\t\t\t$this->share($file);\n\t\t}\n\t}",
"abstract public function flush($bucket);",
"protected function syncCities(){\n $citiesApiJson = $this->_getCitiesFromServer();\n $citiesApi = json_decode($citiesApiJson);\n if (property_exists($citiesApi, 'success') && $citiesApi->success === true) {\n $this->_syncWithDb($citiesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($citiesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n }",
"public function buckets($buckets)\n {\n return $this->bucket->buckets($buckets);\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function commitMItemsToDB($bucketname, $cname, $array_data) {\n\t\t\t$json_encoded = json_encode($array_data);\n\t\t\t$url = sprintf(\"http://%s:%[email protected]/%s/%s/_bulk/put_multi\", $this->username, $this->password, $bucketname, $cname); \n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json_encoded);\n\t\t\t\n\t\t\t$response = curl_exec($ch);\n\t\t\tif(!$response) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn json_decode($response);\n\t\t\t}\n\t\t\n\t\t\n\t\t}",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function check_sync() {\n\n\t\t\t// Display notice on success redirect.\n\t\t\tif ( isset( $_GET['acfsynccomplete'] ) ) {\n\t\t\t\t$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) );\n\n\t\t\t\t// Generate text.\n\t\t\t\t$text = sprintf(\n\t\t\t\t\t_n( 'Field group synchronised.', '%s field groups synchronised.', count( $ids ), 'acf' ),\n\t\t\t\t\tcount( $ids )\n\t\t\t\t);\n\n\t\t\t\t// Append links to text.\n\t\t\t\t$links = array();\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$links[] = '<a href=\"' . get_edit_post_link( $id ) . '\">' . get_the_title( $id ) . '</a>';\n\t\t\t\t}\n\t\t\t\t$text .= ' ' . implode( ', ', $links );\n\n\t\t\t\t// Add notice.\n\t\t\t\tacf_add_admin_notice( $text, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Find items to sync.\n\t\t\t$keys = array();\n\t\t\tif ( isset( $_GET['acfsync'] ) ) {\n\t\t\t\t$keys[] = sanitize_text_field( $_GET['acfsync'] );\n\t\t\t} elseif ( isset( $_GET['post'], $_GET['action2'] ) && $_GET['action2'] === 'acfsync' ) {\n\t\t\t\t$keys = array_map( 'sanitize_text_field', $_GET['post'] );\n\t\t\t}\n\n\t\t\tif ( $keys && $this->sync ) {\n\t\t\t\tcheck_admin_referer( 'bulk-posts' );\n\n\t\t\t\t// Disabled \"Local JSON\" controller to prevent the .json file from being modified during import.\n\t\t\t\tacf_update_setting( 'json', false );\n\n\t\t\t\t// Sync field groups and generate array of new IDs.\n\t\t\t\t$files = acf_get_local_json_files();\n\t\t\t\t$new_ids = array();\n\t\t\t\tforeach ( $this->sync as $key => $field_group ) {\n\t\t\t\t\tif ( $field_group['key'] && in_array( $field_group['key'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} elseif ( $field_group['ID'] && in_array( $field_group['ID'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Ignore.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$local_field_group = json_decode( file_get_contents( $files[ $key ] ), true );\n\t\t\t\t\t$local_field_group['ID'] = $field_group['ID'];\n\t\t\t\t\t$result = acf_import_field_group( $local_field_group );\n\t\t\t\t\t$new_ids[] = $result['ID'];\n\t\t\t\t}\n\n\t\t\t\t// Redirect.\n\t\t\t\twp_redirect( $this->get_current_admin_url( '&acfsynccomplete=' . implode( ',', $new_ids ) ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t}",
"function sync(){\n $aws_cognito_graphql_options = get_option( 'aws_cognito_graphql_option_name' ); // Array of All Options\n $aws_cognito_region = $aws_cognito_graphql_options['aws_cognito_region']; // Region\n $aws_cognito_poolid = $aws_cognito_graphql_options['aws_cognito_poolid']; // Pool Id\n\n // create the jwks url\n $url = \"https://cognito-idp.\" . $aws_cognito_region . \".amazonaws.com/\" . $aws_cognito_poolid . \"/.well-known/jwks.json\";\n\n // fetch the json\n $cognito_response = wp_remote_get($url);\n $body = wp_remote_retrieve_body($cognito_response);\n $jwks = json_decode(json_encode($body));\n\n $updated = update_option('cognito_jwks', $jwks);\n\n $response = array();\n $response['response'] = $jwks;\n\n header( \"Content-Type: application/json\" );\n echo json_encode($response);\n\n //Don't forget to always exit in the ajax function.\n exit();\n}",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncWarehouses(){\n $warehousesApiJson = $this->_getWarehousesFromServer();\n $warehousesApi = json_decode($warehousesApiJson);\n if (property_exists($warehousesApi, 'success') && $warehousesApi->success === true) {\n $this->_syncWarehousesWithDb($warehousesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($warehousesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public static function syncAllGitRepos() {\n\t\tglobal $mwtExtensions, $mwtDocRoot;\n\t\t// Core\n\t\tself::syncCoreGit();\n\t\t// Extensions\n\t\tforeach( $mwtExtensions as $extension ) {\n\t\t\t$extension->sync();\n\t\t}\n\t}",
"public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function get_objects($bucket)\n{\n $objects = array();\n $storage = new StorageClient();\n $bucket = $storage->bucket($bucket);\n foreach ($bucket->objects() as $object) {\n $url = 'https://' . $bucket->name() . '.storage.googleapis.com/' . $object->name();\n $objInfo = array();\n $objInfo[\"name\"] = $object->name();\n $objInfo[\"url\"] = $url;\n array_push($objects, $objInfo);\n }\n return $objects;\n}",
"public function sync()\n {\n $response = array('success' => true, 'message' => 'Done.');\n\n // Initialise a return hash containing results of our sync attempt\n $this->_searchAccounts();\n\n foreach ($this->accounts as $account) {\n $orders = $account->getOrders();\n $orderIds = $account->getOrderIds();\n $ordersForSingleSync = $account->getOrdersForSingleSync();\n $orderIdsForSingleSync = $account->getOrderIdsForSingleSync();\n $numOrdersForSingleSync = count($ordersForSingleSync);\n $website = $account->getWebsites();\n $numOrders = count($orders);\n $this->_countOrders += $numOrders;\n $this->_countOrders += $numOrdersForSingleSync;\n //send transactional for any number of orders set\n if ($numOrders) {\n $this->_helper->log(\n '--------- register Order sync with importer ---------- : '\n . count($orders)\n );\n //register in queue with importer\n //$this->_helper->debug('orders', $orders);\n $this->_helper->error('orders', $orders);\n try {\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $orders,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_BULK,\n $website[0]\n );\n } catch (\\Exception $e) {\n $this->_helper->debug((string)$e, array());\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __($e->getMessage())\n );\n }\n\n $this->_setImported($orderIds);\n\n $this->_helper->log('----------end order sync----------');\n }\n\n if ($numOrdersForSingleSync) {\n $error = false;\n foreach ($ordersForSingleSync as $order) {\n $this->_helper->log(\n '--------- register Order sync in single with importer ---------- : '\n . $order->id\n );\n //register in queue with importer\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $order,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_SINGLE,\n $website[0]\n );\n $this->_helper->log(\n '----------end order sync in single----------'\n );\n }\n //if no error then set imported\n if ( ! $error) {\n $this->_setImported($orderIdsForSingleSync, true);\n }\n }\n unset($this->accounts[$account->getApiUsername()]);\n }\n\n if ($this->_countOrders) {\n $response['message'] = 'Number of updated orders : '\n . $this->_countOrders;\n }\n\n return $response;\n }",
"public function cloud_backup($backup_array) {\n\n\t\tglobal $updraftplus;\n\n\t\t$services = (array) $updraftplus->just_one($updraftplus->jobdata_get('service'));\n\t\t$remote_storage_instances = $updraftplus->jobdata_get('remote_storage_instances', array());\n\n\t\t// We need to make sure that the loop below actually runs\n\t\tif (empty($services)) $services = array('none');\n\t\t\n\t\t$storage_objects_and_ids = UpdraftPlus_Storage_Methods_Interface::get_enabled_storage_objects_and_ids($services, $remote_storage_instances);\n\n\t\t$total_instances_count = 0;\n\n\t\tforeach ($storage_objects_and_ids as $service) {\n\t\t\tif ($service['object']->supports_feature('multi_options')) $total_instances_count += count($service['instance_settings']);\n\t\t}\n\n\t\t$updraftplus->jobdata_set('jobstatus', 'clouduploading');\n\n\t\t$updraftplus->register_wp_http_option_hooks();\n\n\t\t$upload_status = $updraftplus->jobdata_get('uploading_substatus');\n\t\tif (!is_array($upload_status) || !isset($upload_status['t'])) {\n\t\t\t$upload_status = array('i' => 0, 'p' => 0, 't' => max(1, $total_instances_count)*count($backup_array));\n\t\t\t$updraftplus->jobdata_set('uploading_substatus', $upload_status);\n\t\t}\n\n\t\t$do_prune = array();\n\n\t\t// If there was no check-in last time, then attempt a different service first - in case a time-out on the attempted service leads to no activity and everything stopping\n\t\tif (count($services) >1 && !empty($updraftplus->no_checkin_last_time)) {\n\t\t\t$updraftplus->log('No check-in last time: will try a different remote service first');\n\t\t\tarray_push($services, array_shift($services));\n\t\t\t// Make sure that the 'no worthwhile activity' detector isn't flumoxed by the starting of a new upload at 0%\n\t\t\tif ($updraftplus->current_resumption > 9) $updraftplus->jobdata_set('uploaded_lastreset', $updraftplus->current_resumption);\n\t\t\tif (1 == ($updraftplus->current_resumption % 2) && count($services)>2) array_push($services, array_shift($services));\n\t\t}\n\n\t\t$errors_before_uploads = $updraftplus->error_count();\n\n\t\tforeach ($services as $ind => $service) {\n\t\t\ttry {\n\t\t\t\t$instance_id_count = 0;\n\t\t\t\t$total_instance_ids = ('none' !== $service && '' !== $service && $storage_objects_and_ids[$service]['object']->supports_feature('multi_options')) ? count($storage_objects_and_ids[$service]['instance_settings']) : 1;\n\t\n\t\t\t\t// Used for logging by record_upload_chunk()\n\t\t\t\t$this->current_service = $service;\n\t\n\t\t\t\t// Used when deciding whether to delete the local file\n\t\t\t\t$this->last_storage_instance = ($ind+1 >= count($services) && $instance_id_count+1 >= $total_instance_ids && $errors_before_uploads == $updraftplus->error_count()) ? true : false;\n\t\t\t\t$log_extra = $this->last_storage_instance ? ' (last)' : '';\n\t\t\t\t$updraftplus->log(\"Cloud backup selection (\".($ind+1).\"/\".count($services).\"): \".$service.\" with instance (\".($instance_id_count+1).\"/\".$total_instance_ids.\")\".$log_extra);\n\t\t\t\tif (function_exists('set_time_limit')) @set_time_limit(UPDRAFTPLUS_SET_TIME_LIMIT);// phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged\n\t\n\t\t\t\tif ('none' == $service || '' == $service) {\n\t\t\t\t\t$updraftplus->log('No remote despatch: user chose no remote backup service');\n\t\t\t\t\t// Still want to mark as \"uploaded\", to signal that nothing more needs doing. (Important on incremental runs with no cloud storage).\n\t\t\t\t\tforeach ($backup_array as $file) {\n\t\t\t\t\t\tif ($updraftplus->is_uploaded($file)) {\n\t\t\t\t\t\t\t$updraftplus->log(\"Already uploaded: $file\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$updraftplus->uploaded_file($file, true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->prune_retained_backups(array('none' => array('all' => array(null, null))));\n\t\t\t\t} elseif (!empty($storage_objects_and_ids[$service]['object']) && !$storage_objects_and_ids[$service]['object']->supports_feature('multi_options')) {\n\t\t\t\t\t$remote_obj = $storage_objects_and_ids[$service]['object'];\n\t\t\t\t\t\n\t\t\t\t\t$do_prune = array_merge_recursive($do_prune, $this->upload_cloud($remote_obj, $service, $backup_array, ''));\n\t\t\t\t} elseif (!empty($storage_objects_and_ids[$service]['instance_settings'])) {\n\t\t\t\t\tforeach ($storage_objects_and_ids[$service]['instance_settings'] as $instance_id => $options) {\n\t\t\t\t\t\n\t\t\t\t\t\tif ($instance_id_count > 0) {\n\t\t\t\t\t\t\t$this->last_storage_instance = ($ind+1 >= count($services) && $instance_id_count+1 >= $total_instance_ids && $errors_before_uploads == $updraftplus->error_count()) ? true : false;\n\t\t\t\t\t\t\t$log_extra = $this->last_storage_instance ? ' (last)' : '';\n\t\t\t\t\t\t\t$updraftplus->log(\"Cloud backup selection (\".($ind+1).\"/\".count($services).\"): \".$service.\" with instance (\".($instance_id_count+1).\"/\".$total_instance_ids.\")\".$log_extra);\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t// Used for logging by record_upload_chunk()\n\t\t\t\t\t\t$this->current_instance = $instance_id;\n\t\n\t\t\t\t\t\tif (!isset($options['instance_enabled'])) $options['instance_enabled'] = 1;\n\t\n\t\t\t\t\t\t// if $remote_storage_instances is not empty then we are looping over a list of instances the user wants to backup to so we want to ignore if the instance is enabled or not\n\t\t\t\t\t\tif (1 == $options['instance_enabled'] || !empty($remote_storage_instances)) {\n\t\t\t\t\t\t\t$remote_obj = $storage_objects_and_ids[$service]['object'];\n\t\t\t\t\t\t\t$remote_obj->set_options($options, true, $instance_id);\n\t\t\t\t\t\t\t$do_prune = array_merge_recursive($do_prune, $this->upload_cloud($remote_obj, $service, $backup_array, $instance_id));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$updraftplus->log(\"This instance id ($instance_id) is set as inactive.\");\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t$instance_id_count++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$log_message = 'Exception ('.get_class($e).') occurred during backup uploads to the '.$service.'. Exception Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\t\t$updraftplus->log($log_message);\n\t\t\t\terror_log($log_message);\n\t\t\t\t$updraftplus->log(sprintf(__('A PHP exception (%s) has occurred: %s', 'updraftplus'), get_class($e), $e->getMessage()), 'error');\n\t\t\t// @codingStandardsIgnoreLine\n\t\t\t} catch (Error $e) {\n\t\t\t\t$log_message = 'PHP Fatal error ('.get_class($e).') has occurred during backup uploads to the '.$service.'. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\t\t$updraftplus->log($log_message);\n\t\t\t\terror_log($log_message);\n\t\t\t\t$updraftplus->log(sprintf(__('A PHP fatal error (%s) has occurred: %s', 'updraftplus'), get_class($e), $e->getMessage()), 'error');\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($do_prune)) $this->prune_retained_backups($do_prune);\n\n\t\t$updraftplus->register_wp_http_option_hooks(false);\n\n\t}",
"public static function syncFromDirectory() {\n $allRecords = UserDirectory::singleton() -> fetchAll();\n\n self::syncUsers($allRecords[\"users\"]);\n self::syncGroups($allRecords[\"groups\"]);\n self::syncMembership($allRecords[\"groups\"]);\n\n // save sync timestamp in wp-option\n self::updateLastSyncTimestamp();\n }"
] | [
"0.61899436",
"0.5856333",
"0.57691664",
"0.5353393",
"0.534763",
"0.51943314",
"0.51644856",
"0.49042347",
"0.48493174",
"0.47461623",
"0.46332476",
"0.45544326",
"0.4329578",
"0.4307458",
"0.42819282",
"0.42620257",
"0.4251409",
"0.4244661",
"0.42141908",
"0.41970837",
"0.41701466",
"0.41620654",
"0.41593686",
"0.4157805",
"0.41445896",
"0.41375253",
"0.41297185",
"0.41070604",
"0.40166646",
"0.40087146"
] | 0.7305017 | 0 |
Operation syncCloudBucketsWithHttpInfo Synchronize internal cloud buckets with their remote equivalent. | public function syncCloudBucketsWithHttpInfo($cloud_connector_id)
{
$request = $this->syncCloudBucketsRequest($cloud_connector_id);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 202:
if ('\NodeumSDK\Client\Model\ActiveJobStatus' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\ActiveJobStatus', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\NodeumSDK\Client\Model\ActiveJobStatus';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\ActiveJobStatus',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function quotesV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.6414517",
"0.60392624",
"0.6001154",
"0.5925676",
"0.56871253",
"0.56235814",
"0.5437238",
"0.51979744",
"0.5194053",
"0.5089278",
"0.5082726",
"0.4914943",
"0.49051404",
"0.48883766",
"0.48599216",
"0.483984",
"0.4788841",
"0.4755815",
"0.47099414",
"0.47059706",
"0.46692124",
"0.46465066",
"0.4555123",
"0.45523286",
"0.4543095",
"0.45287544",
"0.45161077",
"0.44732416",
"0.4460957",
"0.4455021"
] | 0.6256137 | 1 |
Operation syncCloudBucketsAsync Synchronize internal cloud buckets with their remote equivalent. | public function syncCloudBucketsAsync($cloud_connector_id)
{
return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listCurrencyPairsAsync()\n {\n return $this->listCurrencyPairsAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listCandlesticksAsyncWithHttpInfo($currency_pair, $limit = 100, $from = null, $to = null, $interval = '30m')\n {\n $returnType = 'string[][]';\n $request = $this->listCandlesticksRequest($currency_pair, $limit, $from, $to, $interval);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function flushAll($async = null) {}",
"public function listCandlesticksAsync($currency_pair, $limit = 100, $from = null, $to = null, $interval = '30m')\n {\n return $this->listCandlesticksAsyncWithHttpInfo($currency_pair, $limit, $from, $to, $interval)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listMarginCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\MarginCurrencyPair[]';\n $request = $this->listMarginCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"function sync(){\n $aws_cognito_graphql_options = get_option( 'aws_cognito_graphql_option_name' ); // Array of All Options\n $aws_cognito_region = $aws_cognito_graphql_options['aws_cognito_region']; // Region\n $aws_cognito_poolid = $aws_cognito_graphql_options['aws_cognito_poolid']; // Pool Id\n\n // create the jwks url\n $url = \"https://cognito-idp.\" . $aws_cognito_region . \".amazonaws.com/\" . $aws_cognito_poolid . \"/.well-known/jwks.json\";\n\n // fetch the json\n $cognito_response = wp_remote_get($url);\n $body = wp_remote_retrieve_body($cognito_response);\n $jwks = json_decode(json_encode($body));\n\n $updated = update_option('cognito_jwks', $jwks);\n\n $response = array();\n $response['response'] = $jwks;\n\n header( \"Content-Type: application/json\" );\n echo json_encode($response);\n\n //Don't forget to always exit in the ajax function.\n exit();\n}"
] | [
"0.6446134",
"0.6157296",
"0.5938117",
"0.55880994",
"0.5530672",
"0.5524836",
"0.5425786",
"0.53991735",
"0.5064132",
"0.502735",
"0.49966544",
"0.49682978",
"0.45797902",
"0.45348293",
"0.44682094",
"0.4443648",
"0.44292784",
"0.44117168",
"0.4393093",
"0.4340466",
"0.43381602",
"0.42997232",
"0.4270484",
"0.42458275",
"0.42381358",
"0.42147487",
"0.42102948",
"0.41845787",
"0.41172957",
"0.40874723"
] | 0.6736642 | 0 |
Operation syncCloudBucketsAsyncWithHttpInfo Synchronize internal cloud buckets with their remote equivalent. | public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)
{
$returnType = '\NodeumSDK\Client\Model\ActiveJobStatus';
$request = $this->syncCloudBucketsRequest($cloud_connector_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function quotesV2PutAsyncWithHttpInfo($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($id2, $number, $customer_id, $due_date, $quote_date, $created_utc, $approved_date, $currency_code, $status, $currency_rate, $company_reference, $eu_third_party, $customer_reference, $invoice_customer_name, $invoice_address1, $invoice_address2, $invoice_postal_code, $invoice_city, $invoice_country_code, $delivery_customer_name, $delivery_address1, $delivery_address2, $delivery_postal_code, $delivery_city, $delivery_country_code, $delivery_method_name, $delivery_method_code, $delivery_term_code, $delivery_term_name, $customer_is_private_person, $includes_vat, $is_domestic, $rot_reduced_invoicing_type, $rot_property_type, $rot_reduced_invoicing_property_name, $rot_reduced_invoicing_org_number, $rot_reduced_invoicing_amount, $rot_reduced_invoicing_automatic_distribution, $persons, $terms_of_payment, $sales_document_attachments, $rows, $total_amount, $vat_amount, $roundings_amount, $uses_green_technology, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listCandlesticksAsyncWithHttpInfo($currency_pair, $limit = 100, $from = null, $to = null, $interval = '30m')\n {\n $returnType = 'string[][]';\n $request = $this->listCandlesticksRequest($currency_pair, $limit, $from, $to, $interval);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listTickersAsyncWithHttpInfo($currency_pair = null)\n {\n $returnType = '\\GateApi\\Model\\Ticker[]';\n $request = $this->listTickersRequest($currency_pair);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateWarehouseServiceTypeCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateWarehouseServiceTypeCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }"
] | [
"0.67010087",
"0.6265965",
"0.61632943",
"0.58698153",
"0.57803905",
"0.57554734",
"0.57132626",
"0.56143576",
"0.551882",
"0.5517544",
"0.5389203",
"0.5356503",
"0.52616614",
"0.52530354",
"0.5215195",
"0.5204494",
"0.51837426",
"0.5165538",
"0.5112825",
"0.50810295",
"0.4911998",
"0.49091566",
"0.49037847",
"0.48424718",
"0.48332626",
"0.48272148",
"0.48247492",
"0.48079664",
"0.48010883",
"0.47754478"
] | 0.67206854 | 0 |
Create request for operation 'syncCloudBuckets' | protected function syncCloudBucketsRequest($cloud_connector_id)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'queued', 'working', 'failed']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'queued', 'working', 'failed'],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function sync(){\n $aws_cognito_graphql_options = get_option( 'aws_cognito_graphql_option_name' ); // Array of All Options\n $aws_cognito_region = $aws_cognito_graphql_options['aws_cognito_region']; // Region\n $aws_cognito_poolid = $aws_cognito_graphql_options['aws_cognito_poolid']; // Pool Id\n\n // create the jwks url\n $url = \"https://cognito-idp.\" . $aws_cognito_region . \".amazonaws.com/\" . $aws_cognito_poolid . \"/.well-known/jwks.json\";\n\n // fetch the json\n $cognito_response = wp_remote_get($url);\n $body = wp_remote_retrieve_body($cognito_response);\n $jwks = json_decode(json_encode($body));\n\n $updated = update_option('cognito_jwks', $jwks);\n\n $response = array();\n $response['response'] = $jwks;\n\n header( \"Content-Type: application/json\" );\n echo json_encode($response);\n\n //Don't forget to always exit in the ajax function.\n exit();\n}",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function sync_access() {\n\t\tglobal $sync_request_dir;\n\t\t$sync_request = new SyncRequest;\n\t\t$sync_request->server_id = $this->id;\n\t\t$sync_request->account_name = null;\n\t\t$sync_request_dir->add_sync_request($sync_request);\n\t}",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function commitMItemsToDB($bucketname, $cname, $array_data) {\n\t\t\t$json_encoded = json_encode($array_data);\n\t\t\t$url = sprintf(\"http://%s:%[email protected]/%s/%s/_bulk/put_multi\", $this->username, $this->password, $bucketname, $cname); \n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json_encoded);\n\t\t\t\n\t\t\t$response = curl_exec($ch);\n\t\t\tif(!$response) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn json_decode($response);\n\t\t\t}\n\t\t\n\t\t\n\t\t}",
"public function createVpcPrefixListWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->dryRun)) {\n $query['DryRun'] = $request->dryRun;\n }\n if (!Utils::isUnset($request->ipVersion)) {\n $query['IpVersion'] = $request->ipVersion;\n }\n if (!Utils::isUnset($request->maxEntries)) {\n $query['MaxEntries'] = $request->maxEntries;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->prefixListDescription)) {\n $query['PrefixListDescription'] = $request->prefixListDescription;\n }\n if (!Utils::isUnset($request->prefixListEntries)) {\n $query['PrefixListEntries'] = $request->prefixListEntries;\n }\n if (!Utils::isUnset($request->prefixListName)) {\n $query['PrefixListName'] = $request->prefixListName;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceGroupId)) {\n $query['ResourceGroupId'] = $request->resourceGroupId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->tag)) {\n $query['Tag'] = $request->tag;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'CreateVpcPrefixList',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return CreateVpcPrefixListResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"protected function putRequest($command, $params = array()) {\n\n $this->prepareCommand($command, $params);\n\n if ($this->getToken()) {\n $this->curl->setHeader('Authorization', 'Bearer ' . $this->getToken());\n }\n\n $this->curl->put(ZENCI_GOOGLE_CE_API_URI . '/' . $this->project_id . '/' . $command, $params);\n $response = $this->getResponse();\n return $response;\n }",
"protected function listCurrencyPairsRequest()\n {\n\n $resourcePath = '/spot/currency_pairs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $signHeaders = $this->buildSignHeaders('GET', $resourcePath, $query, $httpBody);\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $signHeaders,\n $headers\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncWithCluster(array $query = ['pretty' => 1])\n {\n try {\n return $this->get($query);\n } catch (KubernetesAPIException $e) {\n return $this->create($query);\n }\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function store(BucketStoreRequest $request)\n {\n $bucket = Bucket::create($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was created');\n\n return redirect('/buckets');\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function __construct($bucketKeys) { }"
] | [
"0.6345131",
"0.58453315",
"0.5518078",
"0.55129373",
"0.5475518",
"0.5362501",
"0.53186417",
"0.51546204",
"0.514462",
"0.50850916",
"0.5029308",
"0.50229424",
"0.4950024",
"0.4836634",
"0.48350412",
"0.48069885",
"0.47864994",
"0.47802928",
"0.47148615",
"0.4669784",
"0.46657902",
"0.46288624",
"0.46287093",
"0.4625992",
"0.46162292",
"0.4613978",
"0.45940062",
"0.45917103",
"0.4580304",
"0.45467925"
] | 0.7084247 | 0 |
Operation syncResultCloudBuckets Check result of cloud connector sync job. | public function syncResultCloudBuckets($cloud_connector_id, $job_id)
{
list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function checkCloud()\n {\n $baseUri = '/cgi/tbl/Cloud';\n return $this->runQuery($baseUri, false);\n }",
"public function GetUploadMassContactsResult(GetUploadMassContactsResult $parameters)\n {\n return $this->__soapCall('GetUploadMassContactsResult', array($parameters));\n }",
"public function getSyncStatus(){\n $command = new Command($this->host, self::LOADER_GET_SYNC,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"private function _sync_progress(){\n\t\t\tsleep(10);\n\t\t\t\n\t\t\t$settings = array(\n\t\t\t\t'cache_key' => \"synchronization\",\n\t\t\t\t'permanent' => true,\n\t\t\t);\n\t\t\t$value = get_cache_for_special_values( $settings );\n\t\t\tif( $value == 2 ){\n\t\t\t\t//sync complete\n\t\t\t\t$err = new cError(010011);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t$err->class_that_triggered_error = 'cAudit.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_sync_progress';\n\t\t\t\t$err->additional_details_of_error = '<h4>Request Complete</h4>';\n\t\t\t\t$return = $err->error();\n\t\t\t\tunset( $return[\"html\"] );\n\t\t\t\t\n\t\t\t\t$return['html_prepend'] = \"<li><strong>Request Complete!!!</strong></li>\";\n\t\t\t\t\n\t\t\t\t$settings = array(\n\t\t\t\t\t'cache_key' => \"synchronization-message\",\n\t\t\t\t\t'permanent' => true,\n\t\t\t\t);\n\t\t\t\t$msg = get_cache_for_special_values( $settings );\n\t\t\t\tif( isset( $msg[\"title\"] ) && isset( $msg[\"msg\"] ) ){\n\t\t\t\t\t$return['html_prepend'] .= \"<li><strong>\".$msg[\"title\"].\"</strong><br />\".$msg[\"msg\"].\"</li>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return['status'] = \"new-status\";\n\t\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\t$return['complete'] = 1;\n\t\t\t\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t\n\t\t\t$return['html_prepend'] = \"<li>Please wait. Processing Request...</li>\";\n\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\n\t\t\t$return['status'] = \"new-status\";\n\t\t\t$return['re_process'] = 1;\n\t\t\t$return['re_process_code'] = 1;\n\t\t\t$return['mod'] = 'import-';\n\t\t\t\n\t\t\t$return['id'] = ( isset( $this->class_settings[ 'sync_id' ] )?$this->class_settings[ 'sync_id' ]:1 );\n\t\t\t$return['action'] = ( isset( $this->class_settings[ 'sync_action' ] )?$this->class_settings[ 'sync_action' ]:'?action=audit&todo=sync_progress' );\n\t\t\t\n\t\t\treturn $return;\n\t\t}",
"public function __syncConnectCheck($result) {\n $this->assertInstanceOf('SignalWire\\Relay\\Calling\\Results\\ConnectResult', $result);\n $this->assertTrue($result->isSuccessful());\n $peerCall = $result->getCall();\n $this->assertEquals($peerCall, $this->call->peer);\n $this->assertEquals($peerCall->id, 'peer-call-id');\n $this->assertEquals($peerCall->peer, $this->call);\n $this->assertObjectHasAttribute('peer', $result->getEvent()->payload);\n $this->assertObjectHasAttribute('connect_state', $result->getEvent()->payload);\n }",
"public function check_sync() {\n\n\t\t\t// Display notice on success redirect.\n\t\t\tif ( isset( $_GET['acfsynccomplete'] ) ) {\n\t\t\t\t$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) );\n\n\t\t\t\t// Generate text.\n\t\t\t\t$text = sprintf(\n\t\t\t\t\t_n( 'Field group synchronised.', '%s field groups synchronised.', count( $ids ), 'acf' ),\n\t\t\t\t\tcount( $ids )\n\t\t\t\t);\n\n\t\t\t\t// Append links to text.\n\t\t\t\t$links = array();\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$links[] = '<a href=\"' . get_edit_post_link( $id ) . '\">' . get_the_title( $id ) . '</a>';\n\t\t\t\t}\n\t\t\t\t$text .= ' ' . implode( ', ', $links );\n\n\t\t\t\t// Add notice.\n\t\t\t\tacf_add_admin_notice( $text, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Find items to sync.\n\t\t\t$keys = array();\n\t\t\tif ( isset( $_GET['acfsync'] ) ) {\n\t\t\t\t$keys[] = sanitize_text_field( $_GET['acfsync'] );\n\t\t\t} elseif ( isset( $_GET['post'], $_GET['action2'] ) && $_GET['action2'] === 'acfsync' ) {\n\t\t\t\t$keys = array_map( 'sanitize_text_field', $_GET['post'] );\n\t\t\t}\n\n\t\t\tif ( $keys && $this->sync ) {\n\t\t\t\tcheck_admin_referer( 'bulk-posts' );\n\n\t\t\t\t// Disabled \"Local JSON\" controller to prevent the .json file from being modified during import.\n\t\t\t\tacf_update_setting( 'json', false );\n\n\t\t\t\t// Sync field groups and generate array of new IDs.\n\t\t\t\t$files = acf_get_local_json_files();\n\t\t\t\t$new_ids = array();\n\t\t\t\tforeach ( $this->sync as $key => $field_group ) {\n\t\t\t\t\tif ( $field_group['key'] && in_array( $field_group['key'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} elseif ( $field_group['ID'] && in_array( $field_group['ID'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Ignore.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$local_field_group = json_decode( file_get_contents( $files[ $key ] ), true );\n\t\t\t\t\t$local_field_group['ID'] = $field_group['ID'];\n\t\t\t\t\t$result = acf_import_field_group( $local_field_group );\n\t\t\t\t\t$new_ids[] = $result['ID'];\n\t\t\t\t}\n\n\t\t\t\t// Redirect.\n\t\t\t\twp_redirect( $this->get_current_admin_url( '&acfsynccomplete=' . implode( ',', $new_ids ) ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t}",
"public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }",
"public function syncObjects() {\n\t\t$data = $this->CompliancePackageItem->find('list', [\n\t\t\t'fields' => ['id'],\n\t\t\t'recursive' => -1\n\t\t]);\n\n\t\treturn $this->ComplianceAnalysisFinding->complianceIntegrityCheck($data);\n\t}",
"public function actionResult()\n {\n $reqData = \\Yii::$app->request->post();\n foreach ($reqData as $taskInfo) { // taskInfo: {\"crack_id\":\"\",\"start\":\"\",\"offset\":\"\",\"result\":\"\",\"status\":\"\"}\n $task = \\Yii::$app->db->createCommand(\"SELECT crack_id FROM {{%task}} WHERE crack_id = :crackId AND start = :start AND offset = :offset\", [\n ':crackId' => $taskInfo['crack_id'],\n ':start' => $taskInfo['start'],\n ':offset' => $taskInfo['offset']\n ])->queryScalar();\n \n if ($task) { // Task is valid\n if (isset($taskInfo['status'])) {\n $status = $taskInfo['status'];\n if (($status === 0) || ($status === '0')) {\n $status = 0;\n } else {\n $status = intval($status);\n if ($status == 0) // intval() failed\n $status = - 127;\n }\n } else {\n $status = - 127;\n }\n \n if (($status === 0) && (! empty($taskInfo['result']))) { // Result exists and is valid\n $result = explode(\"\\n\", str_replace([\n \"\\r\\n\",\n \"\\r\"\n ], \"\\n\", base64_decode($taskInfo['result'])));\n \n // Remove empty results\n $result = array_diff($result, [\n ''\n ]);\n \n $transaction = \\Yii::$app->db->beginTransaction();\n \n $crack = \\Yii::$app->db->createCommand(\"SELECT result, target, status FROM {{%crack}} WHERE id = :crackId\", [\n ':crackId' => $taskInfo['crack_id']\n ])->queryOne(\\PDO::FETCH_ASSOC);\n \n // Should update ts_last_connect\n if ($crack['status'] < 2) { // It's not a finished crack\n $setTsLastConnect = ', ts_last_connect = ' . gmdate('U');\n } else {\n $setTsLastConnect = '';\n }\n \n // Remove duplicate results\n if (! empty($crack['result'])) {\n $crackResult = explode(\"\\n\", $crack['result']);\n $result = array_unique(array_merge($crackResult, $result));\n }\n \n // Check if crack is finished now\n if (count(explode(\"\\n\", $crack['target'])) <= count($result)) {\n $setStatus = ', status = 2'; // Crack is finished\n } else {\n $setStatus = '';\n }\n \n \\Yii::$app->db->createCommand(\"UPDATE {{%crack}} SET result = :result $setTsLastConnect $setStatus WHERE id = :id\", [\n ':result' => implode(\"\\n\", $result),\n ':id' => $taskInfo['crack_id']\n ])->execute();\n \n $transaction->commit();\n }\n \n // Update task status\n \\Yii::$app->db->createCommand(\"UPDATE {{%task}} SET status = :status, ts_save = :tsSave WHERE crack_id = :crackId AND start = :start AND offset = :offset\", [\n ':status' => $status,\n ':tsSave' => gmdate('U'),\n ':crackId' => $taskInfo['crack_id'],\n ':start' => $taskInfo['start'],\n ':offset' => $taskInfo['offset']\n ])->execute();\n \n // Should mark the crack as finished\n if ($status === 0) { // At least the current task was ok\n if (isset($crack['status'])) {\n $crackStatus = $crack['status'];\n } else {\n $crackStatus = \\Yii::$app->db->createCommand(\"SELECT status from {{%crack}} WHERE id = :crackId\", [\n ':crackId' => $taskInfo['crack_id']\n ])->queryScalar();\n }\n \n if ($crackStatus == 1) { // All keys were assigned\n if (\\Yii::$app->db->createCommand(\"SELECT crack_id FROM {{%task}} WHERE crack_id = :crackId AND (status IS NULL OR status <> 0) LIMIT 1\", [\n ':crackId' => $taskInfo['crack_id']\n ])->queryOne() === false) { // No invalid task found, so mark the crack as finished\n \\Yii::$app->db->createCommand(\"UPDATE {{%crack}} SET status = 2 WHERE id = :crackId\", [\n ':crackId' => $taskInfo['crack_id']\n ])->execute();\n }\n }\n }\n }\n }\n }",
"protected function execute()\n {\n // Finished\n if ($this->isFinished()) {\n $this->log(\"Verifying files finished\");\n $this->prepareResponse(true, false);\n return false;\n }\n\n // Get files and copy'em\n if (!$this->getFilesAndVerify()) {\n $this->prepareResponse(false, false);\n $this->saveOptions();\n return false;\n }\n\n // Prepare and return response\n $this->prepareResponse();\n\n // Not finished\n return true;\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function actionStatus()\n {\n $this->requirePostRequest();\n\n //var_dump(Craft::$app->getRequest()); die;\n $logFile = Craft::$app->getRequest()->getRequiredBodyParam('logFile');\n $env = Craft::$app->getRequest()->getRequiredBodyParam('env');\n // $jsonBody = Craft::$app->getRequest()->getRawBody();\n // $body = Json::decode($jsonBody, false);\n if (!self::$syncDb) {\n self::$syncDb = SyncDbPlugin::getInstance()->syncDb;\n }\n\n // if (!self::$syncDb->running() && !self::$syncDb->)\n $filePath = Craft::$app->getPath()->getStoragePath() . '/syncdb-' . $logFile;\n $logger = new Logger('sync');\n $logger->pushHandler(new StreamHandler($filePath, Logger::INFO));\n\n $errors = null;\n $success = null;\n $complete = null;\n $logOutput = null;\n\n if (self::$syncDb->success()) {\n $complete = true;\n $success = true;\n // Finished with success\n } elseif (self::$syncDb->running()) {\n $complete = false;\n // Still running\n } else {\n $errors = true;\n $complete = true;\n $success = false;\n // Finished with error\n }\n $logOutput = \\nl2br(\\file_get_contents($filePath));\n return Json::encode(compact('errors', 'success', 'complete', 'logOutput'));\n }",
"public function sync()\n {\n $sql=\"SELECT id, email FROM client WHERE 1\";\n $res = R::getAll($sql);\n\n $log = '';\n foreach($res as $c) {\n try {\n $this->service->mailchimpSubscribe($c['id']);\n $log .= sprintf('Client #%s %s synced', $c['id'], $c['email']) . PHP_EOL;\n } catch (Exception $exc) {\n error_log($exc->getMessage());\n $log .= $exc->getMessage() . PHP_EOL;\n }\n }\n \n return $log;\n }",
"public function sync()\n {\n CmsUser::sync();\n pushNotify('success', __('CmsUser successfully synchronized'));\n\n return $this->success();\n }",
"protected function syncCities(){\n $citiesApiJson = $this->_getCitiesFromServer();\n $citiesApi = json_decode($citiesApiJson);\n if (property_exists($citiesApi, 'success') && $citiesApi->success === true) {\n $this->_syncWithDb($citiesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($citiesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n }",
"public function sync()\n {\n $response = array('success' => true, 'message' => 'Done.');\n\n // Initialise a return hash containing results of our sync attempt\n $this->_searchAccounts();\n\n foreach ($this->accounts as $account) {\n $orders = $account->getOrders();\n $orderIds = $account->getOrderIds();\n $ordersForSingleSync = $account->getOrdersForSingleSync();\n $orderIdsForSingleSync = $account->getOrderIdsForSingleSync();\n $numOrdersForSingleSync = count($ordersForSingleSync);\n $website = $account->getWebsites();\n $numOrders = count($orders);\n $this->_countOrders += $numOrders;\n $this->_countOrders += $numOrdersForSingleSync;\n //send transactional for any number of orders set\n if ($numOrders) {\n $this->_helper->log(\n '--------- register Order sync with importer ---------- : '\n . count($orders)\n );\n //register in queue with importer\n //$this->_helper->debug('orders', $orders);\n $this->_helper->error('orders', $orders);\n try {\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $orders,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_BULK,\n $website[0]\n );\n } catch (\\Exception $e) {\n $this->_helper->debug((string)$e, array());\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __($e->getMessage())\n );\n }\n\n $this->_setImported($orderIds);\n\n $this->_helper->log('----------end order sync----------');\n }\n\n if ($numOrdersForSingleSync) {\n $error = false;\n foreach ($ordersForSingleSync as $order) {\n $this->_helper->log(\n '--------- register Order sync in single with importer ---------- : '\n . $order->id\n );\n //register in queue with importer\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $order,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_SINGLE,\n $website[0]\n );\n $this->_helper->log(\n '----------end order sync in single----------'\n );\n }\n //if no error then set imported\n if ( ! $error) {\n $this->_setImported($orderIdsForSingleSync, true);\n }\n }\n unset($this->accounts[$account->getApiUsername()]);\n }\n\n if ($this->_countOrders) {\n $response['message'] = 'Number of updated orders : '\n . $this->_countOrders;\n }\n\n return $response;\n }",
"public function syncValues() {\n\t\t$DashboardKpi = ClassRegistry::init('Dashboard.DashboardKpi');\n\t\t$kpi = $DashboardKpi->find('list', [\n\t\t\t'fields' => ['id'],\n\t\t\t'recursive' => -1\n\t\t]);\n\n\t\t$ret = true;\n\t\tforeach ($kpi as $kpiId) {\n\t\t\t$ret &= $DashboardKpi->recalculate($kpiId);\n\t\t}\n\n\t\t$ret &= $this->_saveInternalLog(DashboardLog::TYPE_RECALCULATION);\n\n\t\treturn $ret;\n\t}",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"function ciniki_tenants_syncCheckRowCounts($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'sync_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Sync'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.syncCheckRowCounts');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbGetRowCounts');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'syncLoad');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'syncRequest');\n\n //\n // Get the local object table counts\n //\n $rc = ciniki_core_dbGetRowCounts($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $modules = $rc['modules'];\n\n //\n // Get the list of syncs, or just one if specified\n //\n $strsql = \"SELECT ciniki_tenant_syncs.id, \"\n . \"ciniki_tenant_syncs.remote_name, ciniki_tenant_syncs.remote_uuid \"\n . \"FROM ciniki_tenant_syncs \"\n . \"WHERE ciniki_tenant_syncs.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND status = 10 \";\n if( isset($args['sync_id']) && $args['sync_id'] != '' ) {\n $strsql .= \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['sync_id']) . \"' \";\n }\n $strsql .= \"ORDER BY remote_name \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'syncs', 'fname'=>'id', 'name'=>'sync',\n 'fields'=>array('id', 'name'=>'remote_name', 'remote_uuid')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['syncs']) ) {\n $syncs = array();\n } else {\n $syncs = $rc['syncs'];\n }\n\n //\n // loop through all remote syncs and get the table counts\n //\n foreach($syncs as $sid => $s) {\n $rc = ciniki_core_syncLoad($ciniki, $args['tnid'], $s['sync']['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $sync = $rc['sync'];\n\n $rc = ciniki_core_syncRequest($ciniki, $sync, array('method'=>'ciniki.core.rowCounts'));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $remote_modules = $rc['modules'];\n \n //\n // Add remote information to modules\n //\n foreach($modules as $mid => $mod) {\n if( !isset($mod['tables']) ) {\n continue;\n }\n foreach($mod['tables'] as $tid => $table) {\n if( isset($remote_modules[$mid]['tables'][$tid]['rows']) ) {\n $modules[$mid]['tables'][$tid]['sync-' . $s['sync']['id']] = $remote_modules[$mid]['tables'][$tid]['rows'];\n if( $table['rows'] != $remote_modules[$mid]['tables'][$tid]['rows'] ) {\n $modules[$mid]['tables'][$tid]['flagged'] = 'yes'; \n }\n } else {\n $modules[$mid]['tables'][$tid]['flagged'] = 'yes';\n }\n }\n }\n }\n\n //\n // Expand modules to be proper return array, adding 'module' and 'table'\n //\n $mods = array();\n foreach($modules as $mid => $mod) {\n $tables = array();\n if( isset($mod['tables']) ) {\n foreach($mod['tables'] as $tid => $table) {\n $tables[] = array('table'=>$table);\n }\n }\n $mods[] = array('module'=>array('name'=>$mid, 'tables'=>$tables));\n }\n\n // hard coded return value, so the sync information does not also get passed back.\n return array('stat'=>'ok', 'syncs'=>$syncs, 'modules'=>$mods);\n}",
"function googleContactsSync()\r\n{\r\n $admin = new Administration();\r\n $admin->retrieveSettings();\r\n if (GoogleHelper::check_column_if_exist($GLOBALS['sugar_config']['dbconfig']['db_name'], 'users', 'enable_gsync')) {\r\n $gh = new GoogleHelper();\r\n //$sql= \"SELECT DISTINCT users.id, users.user_name, users.gmail_id, users.lastsync_contacts,users.gdrive_refresh_code, rt_gsync.id AS GSyncID, rt_gsync.calendar_google, rt_gsync.calendar_sugar, rt_gsync.contacts_google, rt_gsync.contacts_sugar, rt_gsync.documents_google, rt_gsync.documents_sugar FROM users LEFT JOIN rt_gsync ON rt_gsync.id=users.id AND rt_gsync.deleted='0' WHERE users.deleted='0' AND users.status='Active' AND enable_gsync=1\";\r\n $module = \"Users\";\r\n $q = new SugarQuery();\r\n $q->from(BeanFactory::getBean($module), array('team_security' => false));\r\n $q->joinTable('rt_gsync', array('joinType' => 'LEFT'))->on()->equalsField('users.id', 'rt_gsync.id.user_id')->equals('rt_gsync.deleted', '0');\r\n $q->select(array('users.id', 'users.user_name', 'users.gmail_id', 'users.lastsync_contacts', 'users.gdrive_refresh_code', array('rt_gsync.id', 'GSyncID'), 'rt_gsync.calendar_google', 'rt_gsync.calendar_sugar', 'rt_gsync.contacts_google', 'rt_gsync.contacts_sugar', 'rt_gsync.documents_google', 'rt_gsync.documents_sugar'));\r\n $q->where()->equals('users.status', 'Active')->equals('users.enable_gsync', 1);\r\n $q->distinct(true);\r\n //$sql = $q->compileSql();\r\n //$res = $GLOBALS['db']->query($sql);\r\n $res = $q->execute();\r\n $processed = array();\r\n //while ($row = $GLOBALS['db']->fetchByAssoc($res)) {\r\n foreach ($res as $row) {\r\n $schedulers = array();\r\n try {\r\n //if not saved \r\n if (empty($row['GSyncID'])) {\r\n $schedulers = array(\r\n \"calendar_google\" => true,\r\n \"calendar_sugar\" => true,\r\n \"contacts_google\" => false,\r\n \"contacts_sugar\" => true,\r\n \"documents_google\" => true,\r\n \"documents_sugar\" => true\r\n );\r\n } else {\r\n $schedulers = array(\r\n \"calendar_google\" => true,\r\n \"calendar_sugar\" => true,\r\n \"contacts_google\" => $row[\"contacts_google\"],\r\n \"contacts_sugar\" => $row[\"contacts_sugar\"],\r\n \"documents_google\" => $row[\"documents_google\"],\r\n \"documents_sugar\" => $row[\"documents_sugar\"]\r\n );\r\n }\r\n $gh->prefrences = array('schedulers' => $schedulers);\r\n if (!empty($row['gmail_id']) && !empty($row['gdrive_refresh_code']) && ($gh->prefrences[\"schedulers\"][\"contacts_google\"] == true || $gh->prefrences[\"schedulers\"][\"contacts_sugar\"] == true)) {\r\n if (in_array(strtolower($row['gmail_id']), $processed)) {\r\n $GLOBALS['log']->fatal(\"This email (\" . $row['gmail_id'] . \") is configured in multiple users settings,skipping....\");\r\n continue;\r\n } else {\r\n $processed[] = strtolower($row['gmail_id']);\r\n }\r\n $GLOBALS['log']->fatal('STARTED: Contacts sync: ' . $row['user_name'] . '(' . $row['gmail_id'] . ')');\r\n if (empty($row['lastsync_contacts']) || !isset($row['lastsync_contacts'])) {\r\n $row['lastsync_contacts'] = '2013-01-01 01:01:01';\r\n }\r\n $current_date = date($GLOBALS['timedate']->get_db_date_time_format());\r\n $dateAdded = strtotime(date($GLOBALS['timedate']->get_db_date_time_format(), strtotime($current_date)) . \"+03 seconds\");\r\n $last_synch = gmdate($GLOBALS['timedate']->get_db_date_time_format(), $dateAdded);\r\n $gh->performSync($row['gmail_id'], $row['id'], $row['lastsync_contacts'], 'contacts');\r\n //last sync date saving to db\r\n $sql_update = \"UPDATE users set lastsync_contacts='\" . $last_synch . \"' WHERE id='\" . $row['id'] . \"'\";\r\n $res_update = $GLOBALS['db']->query($sql_update);\r\n $GLOBALS['log']->fatal('COMPLETED: Contacts sync: ' . $row['user_name'] . '(' . $row['gmail_id'] . ')');\r\n } else {\r\n if (empty($row['gdrive_refresh_code'])) {\r\n $GLOBALS['log']->fatal(\"Please go to your user profile and re save Gmail id\");\r\n }\r\n }\r\n } catch (Exception $ex) {\r\n $GLOBALS['log']->fatal('ERROR:' . $ex->getMessage());\r\n }\r\n }\r\n return true;\r\n } else {\r\n $GLOBALS['log']->fatal('Gmail Sync failed in CRON run. do quick repair and rebuild first.');\r\n return false;\r\n }\r\n}",
"public function getConnectivityResult(): ?CloudPcConnectivityResult {\n $val = $this->getBackingStore()->get('connectivityResult');\n if (is_null($val) || $val instanceof CloudPcConnectivityResult) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'connectivityResult'\");\n }"
] | [
"0.5721633",
"0.552712",
"0.55022895",
"0.5472308",
"0.50167584",
"0.49112305",
"0.48673734",
"0.4806052",
"0.47268116",
"0.47258395",
"0.4586529",
"0.45611227",
"0.45542583",
"0.44763905",
"0.44205388",
"0.44035435",
"0.43610436",
"0.43328622",
"0.4326634",
"0.42974156",
"0.4267006",
"0.42658848",
"0.42388338",
"0.42276156",
"0.4219089",
"0.41872942",
"0.41442195",
"0.4098861",
"0.40936327",
"0.40810356"
] | 0.7001076 | 0 |
Operation syncResultCloudBucketsWithHttpInfo Check result of cloud connector sync job. | public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)
{
$request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? (string) $e->getResponse()->getBody() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
$responseBody = $response->getBody();
switch($statusCode) {
case 200:
if ('\NodeumSDK\Client\Model\CloudBucketSimpleCollection' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\CloudBucketSimpleCollection', []),
$response->getStatusCode(),
$response->getHeaders()
];
case 202:
if ('\NodeumSDK\Client\Model\ActiveJobStatus' === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, '\NodeumSDK\Client\Model\ActiveJobStatus', []),
$response->getStatusCode(),
$response->getHeaders()
];
}
$returnType = '\NodeumSDK\Client\Model\CloudBucketSimpleCollection';
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
} catch (ApiException $e) {
switch ($e->getCode()) {
case 200:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\CloudBucketSimpleCollection',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
case 202:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\NodeumSDK\Client\Model\ActiveJobStatus',
$e->getResponseHeaders()
);
$e->setResponseObject($data);
break;
}
throw $e;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"private function _sync_progress(){\n\t\t\tsleep(10);\n\t\t\t\n\t\t\t$settings = array(\n\t\t\t\t'cache_key' => \"synchronization\",\n\t\t\t\t'permanent' => true,\n\t\t\t);\n\t\t\t$value = get_cache_for_special_values( $settings );\n\t\t\tif( $value == 2 ){\n\t\t\t\t//sync complete\n\t\t\t\t$err = new cError(010011);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t$err->class_that_triggered_error = 'cAudit.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_sync_progress';\n\t\t\t\t$err->additional_details_of_error = '<h4>Request Complete</h4>';\n\t\t\t\t$return = $err->error();\n\t\t\t\tunset( $return[\"html\"] );\n\t\t\t\t\n\t\t\t\t$return['html_prepend'] = \"<li><strong>Request Complete!!!</strong></li>\";\n\t\t\t\t\n\t\t\t\t$settings = array(\n\t\t\t\t\t'cache_key' => \"synchronization-message\",\n\t\t\t\t\t'permanent' => true,\n\t\t\t\t);\n\t\t\t\t$msg = get_cache_for_special_values( $settings );\n\t\t\t\tif( isset( $msg[\"title\"] ) && isset( $msg[\"msg\"] ) ){\n\t\t\t\t\t$return['html_prepend'] .= \"<li><strong>\".$msg[\"title\"].\"</strong><br />\".$msg[\"msg\"].\"</li>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return['status'] = \"new-status\";\n\t\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\t$return['complete'] = 1;\n\t\t\t\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t\n\t\t\t$return['html_prepend'] = \"<li>Please wait. Processing Request...</li>\";\n\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\n\t\t\t$return['status'] = \"new-status\";\n\t\t\t$return['re_process'] = 1;\n\t\t\t$return['re_process_code'] = 1;\n\t\t\t$return['mod'] = 'import-';\n\t\t\t\n\t\t\t$return['id'] = ( isset( $this->class_settings[ 'sync_id' ] )?$this->class_settings[ 'sync_id' ]:1 );\n\t\t\t$return['action'] = ( isset( $this->class_settings[ 'sync_action' ] )?$this->class_settings[ 'sync_action' ]:'?action=audit&todo=sync_progress' );\n\t\t\t\n\t\t\treturn $return;\n\t\t}",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listMarginCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\MarginCurrencyPair[]';\n $request = $this->listMarginCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }",
"public function searchCompanyAsyncWithHttpInfo()\n {\n $returnType = '';\n $request = $this->searchCompanyRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function syncCities(){\n $citiesApiJson = $this->_getCitiesFromServer();\n $citiesApi = json_decode($citiesApiJson);\n if (property_exists($citiesApi, 'success') && $citiesApi->success === true) {\n $this->_syncWithDb($citiesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($citiesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n }",
"public function runLookAsyncWithHttpInfo($look_id, $result_format, $limit = null, $apply_formatting = null, $apply_vis = null, $cache = null, $image_width = null, $image_height = null, $generate_drill_links = null, $force_production = null, $cache_only = null, $path_prefix = null, $rebuild_pdts = null, $server_table_calcs = null)\n {\n $returnType = 'string';\n $request = $this->runLookRequest($look_id, $result_format, $limit, $apply_formatting, $apply_vis, $cache, $image_width, $image_height, $generate_drill_links, $force_production, $cache_only, $path_prefix, $rebuild_pdts, $server_table_calcs);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }",
"public function actionStatus()\n {\n $this->requirePostRequest();\n\n //var_dump(Craft::$app->getRequest()); die;\n $logFile = Craft::$app->getRequest()->getRequiredBodyParam('logFile');\n $env = Craft::$app->getRequest()->getRequiredBodyParam('env');\n // $jsonBody = Craft::$app->getRequest()->getRawBody();\n // $body = Json::decode($jsonBody, false);\n if (!self::$syncDb) {\n self::$syncDb = SyncDbPlugin::getInstance()->syncDb;\n }\n\n // if (!self::$syncDb->running() && !self::$syncDb->)\n $filePath = Craft::$app->getPath()->getStoragePath() . '/syncdb-' . $logFile;\n $logger = new Logger('sync');\n $logger->pushHandler(new StreamHandler($filePath, Logger::INFO));\n\n $errors = null;\n $success = null;\n $complete = null;\n $logOutput = null;\n\n if (self::$syncDb->success()) {\n $complete = true;\n $success = true;\n // Finished with success\n } elseif (self::$syncDb->running()) {\n $complete = false;\n // Still running\n } else {\n $errors = true;\n $complete = true;\n $success = false;\n // Finished with error\n }\n $logOutput = \\nl2br(\\file_get_contents($filePath));\n return Json::encode(compact('errors', 'success', 'complete', 'logOutput'));\n }"
] | [
"0.6351523",
"0.62152684",
"0.59780097",
"0.5975917",
"0.54869354",
"0.5363339",
"0.5152119",
"0.5012853",
"0.4854813",
"0.48447263",
"0.48134053",
"0.4744341",
"0.47229776",
"0.45835105",
"0.45632413",
"0.4525487",
"0.44888526",
"0.44241408",
"0.42679435",
"0.4220096",
"0.41946542",
"0.41444844",
"0.41412163",
"0.41346565",
"0.41296268",
"0.41118637",
"0.41042492",
"0.4094139",
"0.40622726",
"0.4043307"
] | 0.6727324 | 0 |
Operation syncResultCloudBucketsAsync Check result of cloud connector sync job. | public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)
{
return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getSyncStatus(){\n $command = new Command($this->host, self::LOADER_GET_SYNC,\"GET\", $this->enableCache, $this->cacheLifetime, $this->cacheFolder);\n return $command->execute();\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function checkCloud()\n {\n $baseUri = '/cgi/tbl/Cloud';\n return $this->runQuery($baseUri, false);\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function check_sync() {\n\n\t\t\t// Display notice on success redirect.\n\t\t\tif ( isset( $_GET['acfsynccomplete'] ) ) {\n\t\t\t\t$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) );\n\n\t\t\t\t// Generate text.\n\t\t\t\t$text = sprintf(\n\t\t\t\t\t_n( 'Field group synchronised.', '%s field groups synchronised.', count( $ids ), 'acf' ),\n\t\t\t\t\tcount( $ids )\n\t\t\t\t);\n\n\t\t\t\t// Append links to text.\n\t\t\t\t$links = array();\n\t\t\t\tforeach ( $ids as $id ) {\n\t\t\t\t\t$links[] = '<a href=\"' . get_edit_post_link( $id ) . '\">' . get_the_title( $id ) . '</a>';\n\t\t\t\t}\n\t\t\t\t$text .= ' ' . implode( ', ', $links );\n\n\t\t\t\t// Add notice.\n\t\t\t\tacf_add_admin_notice( $text, 'success' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Find items to sync.\n\t\t\t$keys = array();\n\t\t\tif ( isset( $_GET['acfsync'] ) ) {\n\t\t\t\t$keys[] = sanitize_text_field( $_GET['acfsync'] );\n\t\t\t} elseif ( isset( $_GET['post'], $_GET['action2'] ) && $_GET['action2'] === 'acfsync' ) {\n\t\t\t\t$keys = array_map( 'sanitize_text_field', $_GET['post'] );\n\t\t\t}\n\n\t\t\tif ( $keys && $this->sync ) {\n\t\t\t\tcheck_admin_referer( 'bulk-posts' );\n\n\t\t\t\t// Disabled \"Local JSON\" controller to prevent the .json file from being modified during import.\n\t\t\t\tacf_update_setting( 'json', false );\n\n\t\t\t\t// Sync field groups and generate array of new IDs.\n\t\t\t\t$files = acf_get_local_json_files();\n\t\t\t\t$new_ids = array();\n\t\t\t\tforeach ( $this->sync as $key => $field_group ) {\n\t\t\t\t\tif ( $field_group['key'] && in_array( $field_group['key'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} elseif ( $field_group['ID'] && in_array( $field_group['ID'], $keys ) ) {\n\t\t\t\t\t\t// Import.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Ignore.\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$local_field_group = json_decode( file_get_contents( $files[ $key ] ), true );\n\t\t\t\t\t$local_field_group['ID'] = $field_group['ID'];\n\t\t\t\t\t$result = acf_import_field_group( $local_field_group );\n\t\t\t\t\t$new_ids[] = $result['ID'];\n\t\t\t\t}\n\n\t\t\t\t// Redirect.\n\t\t\t\twp_redirect( $this->get_current_admin_url( '&acfsynccomplete=' . implode( ',', $new_ids ) ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t}",
"private function _sync_progress(){\n\t\t\tsleep(10);\n\t\t\t\n\t\t\t$settings = array(\n\t\t\t\t'cache_key' => \"synchronization\",\n\t\t\t\t'permanent' => true,\n\t\t\t);\n\t\t\t$value = get_cache_for_special_values( $settings );\n\t\t\tif( $value == 2 ){\n\t\t\t\t//sync complete\n\t\t\t\t$err = new cError(010011);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t$err->class_that_triggered_error = 'cAudit.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_sync_progress';\n\t\t\t\t$err->additional_details_of_error = '<h4>Request Complete</h4>';\n\t\t\t\t$return = $err->error();\n\t\t\t\tunset( $return[\"html\"] );\n\t\t\t\t\n\t\t\t\t$return['html_prepend'] = \"<li><strong>Request Complete!!!</strong></li>\";\n\t\t\t\t\n\t\t\t\t$settings = array(\n\t\t\t\t\t'cache_key' => \"synchronization-message\",\n\t\t\t\t\t'permanent' => true,\n\t\t\t\t);\n\t\t\t\t$msg = get_cache_for_special_values( $settings );\n\t\t\t\tif( isset( $msg[\"title\"] ) && isset( $msg[\"msg\"] ) ){\n\t\t\t\t\t$return['html_prepend'] .= \"<li><strong>\".$msg[\"title\"].\"</strong><br />\".$msg[\"msg\"].\"</li>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$return['status'] = \"new-status\";\n\t\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\t$return['complete'] = 1;\n\t\t\t\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t\t\n\t\t\t$return['html_prepend'] = \"<li>Please wait. Processing Request...</li>\";\n\t\t\t$return['html_prepend_selector'] = \"#sync\";\n\t\t\t\n\t\t\t$return['status'] = \"new-status\";\n\t\t\t$return['re_process'] = 1;\n\t\t\t$return['re_process_code'] = 1;\n\t\t\t$return['mod'] = 'import-';\n\t\t\t\n\t\t\t$return['id'] = ( isset( $this->class_settings[ 'sync_id' ] )?$this->class_settings[ 'sync_id' ]:1 );\n\t\t\t$return['action'] = ( isset( $this->class_settings[ 'sync_action' ] )?$this->class_settings[ 'sync_action' ]:'?action=audit&todo=sync_progress' );\n\t\t\t\n\t\t\treturn $return;\n\t\t}",
"public function __syncConnectCheck($result) {\n $this->assertInstanceOf('SignalWire\\Relay\\Calling\\Results\\ConnectResult', $result);\n $this->assertTrue($result->isSuccessful());\n $peerCall = $result->getCall();\n $this->assertEquals($peerCall, $this->call->peer);\n $this->assertEquals($peerCall->id, 'peer-call-id');\n $this->assertEquals($peerCall->peer, $this->call);\n $this->assertObjectHasAttribute('peer', $result->getEvent()->payload);\n $this->assertObjectHasAttribute('connect_state', $result->getEvent()->payload);\n }",
"protected function execute()\n {\n // Finished\n if ($this->isFinished()) {\n $this->log(\"Verifying files finished\");\n $this->prepareResponse(true, false);\n return false;\n }\n\n // Get files and copy'em\n if (!$this->getFilesAndVerify()) {\n $this->prepareResponse(false, false);\n $this->saveOptions();\n return false;\n }\n\n // Prepare and return response\n $this->prepareResponse();\n\n // Not finished\n return true;\n }",
"public function syncObjects() {\n\t\t$data = $this->CompliancePackageItem->find('list', [\n\t\t\t'fields' => ['id'],\n\t\t\t'recursive' => -1\n\t\t]);\n\n\t\treturn $this->ComplianceAnalysisFinding->complianceIntegrityCheck($data);\n\t}",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function listCurrencyPairsAsync()\n {\n return $this->listCurrencyPairsAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function sync()\n {\n CmsUser::sync();\n pushNotify('success', __('CmsUser successfully synchronized'));\n\n return $this->success();\n }",
"protected function syncCities(){\n $citiesApiJson = $this->_getCitiesFromServer();\n $citiesApi = json_decode($citiesApiJson);\n if (property_exists($citiesApi, 'success') && $citiesApi->success === true) {\n $this->_syncWithDb($citiesApi->data);\n $this->messageManager->addSuccess(\n __('Synchronized successfully')\n );\n $this->_redirect('novaposhta/city/index');\n } else {\n $this->messageManager->addError(\n __('Newpost is not responding or responding incorrectly')\n );\n $this->messageManager->addError($citiesApi->message);\n $this->_redirect('novaposhta/city/index');\n }\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"public function GetUploadMassContactsResult(GetUploadMassContactsResult $parameters)\n {\n return $this->__soapCall('GetUploadMassContactsResult', array($parameters));\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function sync()\n {\n $sql=\"SELECT id, email FROM client WHERE 1\";\n $res = R::getAll($sql);\n\n $log = '';\n foreach($res as $c) {\n try {\n $this->service->mailchimpSubscribe($c['id']);\n $log .= sprintf('Client #%s %s synced', $c['id'], $c['email']) . PHP_EOL;\n } catch (Exception $exc) {\n error_log($exc->getMessage());\n $log .= $exc->getMessage() . PHP_EOL;\n }\n }\n \n return $log;\n }",
"public function actionSyncWithRemote() {\n TwitterSync::$plugin->twitterSyncService->sync();\n\n $result = 'Syncing remote Twitter data';\n\n return $result;\n }",
"public function actionStatus()\n {\n $this->requirePostRequest();\n\n //var_dump(Craft::$app->getRequest()); die;\n $logFile = Craft::$app->getRequest()->getRequiredBodyParam('logFile');\n $env = Craft::$app->getRequest()->getRequiredBodyParam('env');\n // $jsonBody = Craft::$app->getRequest()->getRawBody();\n // $body = Json::decode($jsonBody, false);\n if (!self::$syncDb) {\n self::$syncDb = SyncDbPlugin::getInstance()->syncDb;\n }\n\n // if (!self::$syncDb->running() && !self::$syncDb->)\n $filePath = Craft::$app->getPath()->getStoragePath() . '/syncdb-' . $logFile;\n $logger = new Logger('sync');\n $logger->pushHandler(new StreamHandler($filePath, Logger::INFO));\n\n $errors = null;\n $success = null;\n $complete = null;\n $logOutput = null;\n\n if (self::$syncDb->success()) {\n $complete = true;\n $success = true;\n // Finished with success\n } elseif (self::$syncDb->running()) {\n $complete = false;\n // Still running\n } else {\n $errors = true;\n $complete = true;\n $success = false;\n // Finished with error\n }\n $logOutput = \\nl2br(\\file_get_contents($filePath));\n return Json::encode(compact('errors', 'success', 'complete', 'logOutput'));\n }",
"public function sync()\n {\n $response = array('success' => true, 'message' => 'Done.');\n\n // Initialise a return hash containing results of our sync attempt\n $this->_searchAccounts();\n\n foreach ($this->accounts as $account) {\n $orders = $account->getOrders();\n $orderIds = $account->getOrderIds();\n $ordersForSingleSync = $account->getOrdersForSingleSync();\n $orderIdsForSingleSync = $account->getOrderIdsForSingleSync();\n $numOrdersForSingleSync = count($ordersForSingleSync);\n $website = $account->getWebsites();\n $numOrders = count($orders);\n $this->_countOrders += $numOrders;\n $this->_countOrders += $numOrdersForSingleSync;\n //send transactional for any number of orders set\n if ($numOrders) {\n $this->_helper->log(\n '--------- register Order sync with importer ---------- : '\n . count($orders)\n );\n //register in queue with importer\n //$this->_helper->debug('orders', $orders);\n $this->_helper->error('orders', $orders);\n try {\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $orders,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_BULK,\n $website[0]\n );\n } catch (\\Exception $e) {\n $this->_helper->debug((string)$e, array());\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __($e->getMessage())\n );\n }\n\n $this->_setImported($orderIds);\n\n $this->_helper->log('----------end order sync----------');\n }\n\n if ($numOrdersForSingleSync) {\n $error = false;\n foreach ($ordersForSingleSync as $order) {\n $this->_helper->log(\n '--------- register Order sync in single with importer ---------- : '\n . $order->id\n );\n //register in queue with importer\n $this->_importerFactory->create()\n ->registerQueue(\n \\Dotdigitalgroup\\Email\\Model\\Importer::IMPORT_TYPE_ORDERS,\n $order,\n \\Dotdigitalgroup\\Email\\Model\\Importer::MODE_SINGLE,\n $website[0]\n );\n $this->_helper->log(\n '----------end order sync in single----------'\n );\n }\n //if no error then set imported\n if ( ! $error) {\n $this->_setImported($orderIdsForSingleSync, true);\n }\n }\n unset($this->accounts[$account->getApiUsername()]);\n }\n\n if ($this->_countOrders) {\n $response['message'] = 'Number of updated orders : '\n . $this->_countOrders;\n }\n\n return $response;\n }"
] | [
"0.65722287",
"0.56489545",
"0.56351477",
"0.56230986",
"0.5506777",
"0.53866667",
"0.5374436",
"0.5047646",
"0.48202527",
"0.47415558",
"0.44564632",
"0.44511765",
"0.44448704",
"0.44013563",
"0.43924898",
"0.43715674",
"0.43699557",
"0.4331487",
"0.4302496",
"0.4238838",
"0.4197121",
"0.41724324",
"0.41511416",
"0.41301456",
"0.41265684",
"0.4123316",
"0.41194683",
"0.41183737",
"0.40907648",
"0.40680215"
] | 0.62341654 | 1 |
Operation syncResultCloudBucketsAsyncWithHttpInfo Check result of cloud connector sync job. | public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucketSimpleCollection';
$request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\CurrencyPair[]';\n $request = $this->listCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function listMarginCurrencyPairsAsyncWithHttpInfo()\n {\n $returnType = '\\GateApi\\Model\\MarginCurrencyPair[]';\n $request = $this->listMarginCurrencyPairsRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getListObjectStorageAsyncWithHttpInfo(): PromiseInterface\n {\n $request = new Request('GET', 'object-storage');\n\n return $this->client->sendAsync($request)->then(function (UpcloudApiResponse $response) {\n return $response->toArray(ObjectStorageListResponse::class);\n });\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getIntegrationsCredentialsTypesAsyncWithHttpInfo()\n {\n $returnType = '\\PureCloudPlatform\\Client\\V2\\Model\\CredentialTypeListing';\n $request = $this->getIntegrationsCredentialsTypesRequest();\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function getCouponsAsyncWithHttpInfo($applicationId, $campaignId, $pageSize = null, $skip = null, $sort = null, $value = null, $createdBefore = null, $createdAfter = null, $startsAfter = null, $startsBefore = null, $expiresAfter = null, $expiresBefore = null, $valid = null, $batchId = null, $usable = null, $referralId = null, $recipientIntegrationId = null, $exactMatch = false)\n {\n $returnType = '\\TalonOne\\Client\\Model\\InlineResponse2001';\n $request = $this->getCouponsRequest($applicationId, $campaignId, $pageSize, $skip, $sort, $value, $createdBefore, $createdAfter, $startsAfter, $startsBefore, $expiresAfter, $expiresBefore, $valid, $batchId, $usable, $referralId, $recipientIntegrationId, $exactMatch);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function listTickersAsyncWithHttpInfo($currency_pair = null)\n {\n $returnType = '\\GateApi\\Model\\Ticker[]';\n $request = $this->listTickersRequest($currency_pair);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function listCandlesticksAsyncWithHttpInfo($currency_pair, $limit = 100, $from = null, $to = null, $interval = '30m')\n {\n $returnType = 'string[][]';\n $request = $this->listCandlesticksRequest($currency_pair, $limit, $from, $to, $interval);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.6925489",
"0.62395114",
"0.6188",
"0.6186561",
"0.6084542",
"0.6078173",
"0.60319793",
"0.58746576",
"0.58327353",
"0.5498956",
"0.5426244",
"0.53971934",
"0.53271925",
"0.5312157",
"0.5249836",
"0.52056146",
"0.51055324",
"0.5087489",
"0.49846107",
"0.49443537",
"0.49256232",
"0.48824298",
"0.467297",
"0.46481243",
"0.4610299",
"0.46076193",
"0.45471886",
"0.45223063",
"0.451113",
"0.44990242"
] | 0.69514817 | 0 |
Create request for operation 'syncResultCloudBuckets' | protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'
);
}
// verify the required parameter 'job_id' is set
if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $job_id when calling syncResultCloudBuckets'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// query params
if (is_array($job_id)) {
$job_id = ObjectSerializer::serializeCollection($job_id, '', true);
}
if ($job_id !== null) {
$queryParams['job_id'] = $job_id;
}
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json', 'queued', 'working', 'failed', ]
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json', 'queued', 'working', 'failed', ],
[]
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncWithCluster(array $query = ['pretty' => 1])\n {\n try {\n return $this->get($query);\n } catch (KubernetesAPIException $e) {\n return $this->create($query);\n }\n }",
"public function syncResultCloudBuckets($cloud_connector_id, $job_id)\n {\n list($response) = $this->syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id);\n return $response;\n }",
"public function listBuckets()\n {\n $this->_sendCode(self::MSG_CODE_LIST_BUCKETS_REQ);\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_LIST_BUCKETS_RESP) {\n if (!$response->hasBuckets()) {\n return array();\n } else {\n return $response->getBucketsList();\n }\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode); \n }\n }",
"public function listBucketsAction()\n {\n $result = $this->get(\"AwsS3Services\")->listBuckets();\n\n return new Response($result);\n }",
"public function actionLoadBucketData(): Response\n {\n $this->requirePostRequest();\n $this->requireAcceptsJson();\n\n $request = Craft::$app->getRequest();\n $keyId = App::parseEnv($request->getRequiredBodyParam('keyId'));\n $secret = App::parseEnv($request->getRequiredBodyParam('secret'));\n\n try {\n return $this->asJson([\n 'buckets' => Fs::loadBucketList($keyId, $secret),\n ]);\n } catch (\\Throwable $e) {\n return $this->asFailure($e->getMessage());\n }\n }",
"public function query(Query $query):Bucket;",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function listBuckets(){\n $client = $this->buildClient();\n $buckets = $client->listBuckets();\n return $buckets;\n }",
"function sync(){\n $aws_cognito_graphql_options = get_option( 'aws_cognito_graphql_option_name' ); // Array of All Options\n $aws_cognito_region = $aws_cognito_graphql_options['aws_cognito_region']; // Region\n $aws_cognito_poolid = $aws_cognito_graphql_options['aws_cognito_poolid']; // Pool Id\n\n // create the jwks url\n $url = \"https://cognito-idp.\" . $aws_cognito_region . \".amazonaws.com/\" . $aws_cognito_poolid . \"/.well-known/jwks.json\";\n\n // fetch the json\n $cognito_response = wp_remote_get($url);\n $body = wp_remote_retrieve_body($cognito_response);\n $jwks = json_decode(json_encode($body));\n\n $updated = update_option('cognito_jwks', $jwks);\n\n $response = array();\n $response['response'] = $jwks;\n\n header( \"Content-Type: application/json\" );\n echo json_encode($response);\n\n //Don't forget to always exit in the ajax function.\n exit();\n}",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"protected function listCurrencyPairsRequest()\n {\n\n $resourcePath = '/spot/currency_pairs';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $signHeaders = $this->buildSignHeaders('GET', $resourcePath, $query, $httpBody);\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $signHeaders,\n $headers\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function listBuckets() \r\n {\r\n $this->request =& new HTTP_Request($this->serviceUrl);\r\n\t\t$this->initRequest(\"GET\", \"\", \"private\", \"\", \"\", \"\");\r\n $this->request->sendRequest();\r\n $this->gotResponse();\r\n return ($this->responseCode == 200) ? true : false;\r\n\t}",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function bucket($query/*String*/, $bucketField/*String*/, array $queryParams/*array(String=>String)*/){\n\t\t$this->query = $query;\n\t\t$this->queryParams = $queryParams;\n\t\t$this->bucketField = $bucketField;\n\t\t\n\t\treturn $this;\n\t}",
"public function getResponse() \n\t{\n\t\t$query = '';\n\t\tif (sizeof($this->parameters) > 0) \n\t\t{\n\t\t\t$query = substr($this->uri, -1) !== '?' ? '?' : '&';\n\t\t\t\n\t\t\tforeach ($this->parameters as $var => $value)\n\t\t\t\tif ($value == null || $value == '') \n\t\t\t\t\t$query .= $var.'&';\n\t\t\t\telse \n\t\t\t\t\t$query .= $var.'='.$value.'&';\n\t\t\t\t\t\n\t\t\t$query = substr($query, 0, -1);\n\t\t\t$this->uri .= $query;\n\n\t\t\tif (array_key_exists('acl', $this->parameters) ||\n\t\t\tarray_key_exists('location', $this->parameters) ||\n\t\t\tarray_key_exists('torrent', $this->parameters) ||\n\t\t\tarray_key_exists('logging', $this->parameters))\n\t\t\t\t$this->resource .= $query;\n\n\t\t}\n\t\t\n\t\t$url = (($this->ssl && extension_loaded('openssl')) ?\n\t\t'https://':'http://').$this->headers['Host'].$this->uri;\n\t\t//var_dump($this->bucket, $this->uri, $this->resource, $url);\n\n\t\t// Basic setup\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_USERAGENT, 'S3/php');\n\n\t\tif ($this->ssl) {\n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);\n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);\n\t\t}\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\n\t\t// Headers\n\t\t$headers = array(); $amz = array();\n\t\tforeach ($this->amzHeaders as $header => $value)\n\t\t\tif (strlen($value) > 0) $headers[] = $header.': '.$value;\n\t\tforeach ($this->headers as $header => $value)\n\t\t\tif (strlen($value) > 0) $headers[] = $header.': '.$value;\n\n\t\t// Collect AMZ headers for signature\n\t\tforeach ($this->amzHeaders as $header => $value)\n\t\t\tif (strlen($value) > 0) $amz[] = strToLower($header).':'.$value;\n\n\t\t// AMZ headers must be sorted (thanks Malone)\n\t\tif (sizeof($amz) > 0) {\n\t\t\tsort($amz);\n\t\t\t$amz = \"\\n\".implode(\"\\n\", $amz);\n\t\t} else $amz = '';\n\n\t\t// Authorization string\n\t\t$headers[] = 'Authorization: ' . $this->getSignature(\n\t\t\t$this->verb.\"\\n\".\n\t\t\t$this->headers['Content-MD5'].\"\\n\".\n\t\t\t$this->headers['Content-Type'].\"\\n\".\n\t\t\t$this->headers['Date'].$amz.\"\\n\".$this->resource\n\t\t);\n\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\t\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, false);\n\t\tcurl_setopt($curl, CURLOPT_WRITEFUNCTION, array(&$this, '__responseWriteCallback'));\n\t\tcurl_setopt($curl, CURLOPT_HEADERFUNCTION, array(&$this, '__responseHeaderCallback'));\n\t\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n\n\t\t// Request types\n\t\tswitch ($this->verb) {\n\t\t\tcase 'GET': break;\n\t\t\tcase 'PUT':\n\t\t\t\tif ($this->fp !== false) {\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_PUT, true);\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_INFILE, $this->fp);\n\t\t\t\t\tif ($this->size > 0)\n\t\t\t\t\t\tcurl_setopt($curl, CURLOPT_INFILESIZE, $this->size);\n\t\t\t\t} elseif ($this->data !== false) {\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $this->data);\n\t\t\t\t\tif ($this->size > 0)\n\t\t\t\t\t\tcurl_setopt($curl, CURLOPT_BUFFERSIZE, $this->size);\n\t\t\t\t} else\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\tbreak;\n\t\t\tcase 'HEAD':\n\t\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'HEAD');\n\t\t\t\tcurl_setopt($curl, CURLOPT_NOBODY, true);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tbreak;\n\t\t\tdefault: break;\n\t\t}\n\n\t\t// Execute, grab errors\n\t\tif (curl_exec($curl))\n\t\t\t$this->response->code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\t\telse\n\t\t\t$this->response->error = array(\n\t\t\t\t'code' => curl_errno($curl),\n\t\t\t\t'message' => curl_error($curl),\n\t\t\t\t'resource' => $this->resource\n\t\t\t);\n\n\t\t@curl_close($curl);\n\n\t\t// Parse body into XML\n\t\tif ($this->response->error === false && isset($this->response->headers['type']) &&\n\t\t$this->response->headers['type'] == 'application/xml' && isset($this->response->body)) {\n\t\t\t$this->response->body = simplexml_load_string($this->response->body);\n\n\t\t\t// Grab S3 errors\n\t\t\tif (!in_array($this->response->code, array(200, 204)) &&\n\t\t\tisset($this->response->body->Code, $this->response->body->Message)) {\n\t\t\t\t$this->response->error = array(\n\t\t\t\t\t'code' => (string)$this->response->body->Code,\n\t\t\t\t\t'message' => (string)$this->response->body->Message\n\t\t\t\t);\n\t\t\t\tif (isset($this->response->body->Resource))\n\t\t\t\t\t$this->response->error['resource'] = (string)$this->response->body->Resource;\n\t\t\t\tunset($this->response->body);\n\t\t\t}\n\t\t}\n\n\t\t// Clean up file resources\n\t\tif ($this->fp !== false && is_resource($this->fp)) fclose($this->fp);\n\n\t\treturn $this->response;\n\t}",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.67503464",
"0.551767",
"0.5455295",
"0.54156184",
"0.5364406",
"0.5234337",
"0.5195537",
"0.5179908",
"0.5109999",
"0.49328476",
"0.49322808",
"0.48954073",
"0.4887354",
"0.4873834",
"0.47985154",
"0.47979102",
"0.47610822",
"0.475786",
"0.47231597",
"0.46938524",
"0.45804802",
"0.4556303",
"0.4519041",
"0.45187274",
"0.45182964",
"0.4513144",
"0.4512562",
"0.44626",
"0.44462204",
"0.4427124"
] | 0.66469216 | 1 |
Operation updateCloudBucketAsync Updates a specific cloud bucket. | public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)
{
return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateZoneSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n return $this->updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateLayerAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateLayerAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateZoneAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateZoneAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateApplicationUsingPutAsync($application, $application_id)\n {\n return $this->updateApplicationUsingPutAsyncWithHttpInfo($application, $application_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketAsync($cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsync($cloud_bucket_id)\n {\n return $this->showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateIfcAsync($cloud_pk, $id, $project_pk, $data)\n {\n return $this->updateIfcAsyncWithHttpInfo($cloud_pk, $id, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSystemAsync($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n {\n return $this->updateSystemAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function imGroupUpdateAsync($group_id, $im_group_update_request)\n {\n return $this->imGroupUpdateAsyncWithHttpInfo($group_id, $im_group_update_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCartAsync($body)\n {\n return $this->updateCartAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCampaignAsync($applicationId, $campaignId, $body)\n {\n return $this->updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function drivesUpdateAsync($id, $drive, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $raw = false)\n {\n return $this->drivesUpdateAsyncWithHttpInfo($id, $drive, $x_apideck_consumer_id, $x_apideck_app_id, $x_apideck_service_id, $raw)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateAsync($object_id, $blog_post, $archived = null)\n {\n return $this->updateAsyncWithHttpInfo($object_id, $blog_post, $archived)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.6611075",
"0.64791024",
"0.6200913",
"0.6069039",
"0.59186596",
"0.5751289",
"0.5479515",
"0.53785354",
"0.5246291",
"0.5216034",
"0.50677156",
"0.50163233",
"0.49796975",
"0.4933775",
"0.48792544",
"0.48610035",
"0.48589",
"0.48398343",
"0.48181227",
"0.4794441",
"0.47098327",
"0.47015792",
"0.46832335",
"0.46743217",
"0.46739063",
"0.4649663",
"0.4631609",
"0.45907715",
"0.45827872",
"0.4577058"
] | 0.72162557 | 0 |
Operation updateCloudBucketAsyncWithHttpInfo Updates a specific cloud bucket. | public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCartAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateCartRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function quotesV2PutAsyncWithHttpInfo($body, $id)\n {\n $returnType = 'object';\n $request = $this->quotesV2PutRequest($body, $id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateApplicationUsingPutAsyncWithHttpInfo($application, $application_id)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Application';\n $request = $this->updateApplicationUsingPutRequest($application, $application_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ZoneSpace';\n $request = $this->updateZoneSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function accountsUpdateAsyncWithHttpInfo($api_key, $v, $content_type, $body)\n {\n $returnType = '';\n $request = $this->accountsUpdateRequest($api_key, $v, $content_type, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Space';\n $request = $this->updateSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateCampaignAsyncWithHttpInfo($applicationId, $campaignId, $body)\n {\n $returnType = '\\TalonOne\\Client\\Model\\Campaign';\n $request = $this->updateCampaignRequest($applicationId, $campaignId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function contactsEmailPutAsyncWithHttpInfo($email, $body)\n {\n $returnType = '\\Swagger\\Client\\Model\\Contact';\n $request = $this->contactsEmailPutRequest($email, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateAisleCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateAisleCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function drivesUpdateAsyncWithHttpInfo($id, $drive, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $raw = false)\n {\n $returnType = '\\Apideck\\Client\\Model\\UpdateDriveResponse';\n $request = $this->drivesUpdateRequest($id, $drive, $x_apideck_consumer_id, $x_apideck_app_id, $x_apideck_service_id, $raw);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateAnAccountAsyncWithHttpInfo($account_id, $account_request = null)\n {\n $returnType = '';\n $request = $this->updateAnAccountRequest($account_id, $account_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateZoneAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Zone';\n $request = $this->updateZoneRequest($cloud_pk, $id, $ifc_pk, $project_pk, $data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | [
"0.7266786",
"0.66491807",
"0.6558989",
"0.6240124",
"0.6136286",
"0.5900055",
"0.58161795",
"0.55511236",
"0.5438428",
"0.54327977",
"0.5394623",
"0.5354658",
"0.5344211",
"0.53285927",
"0.52681035",
"0.5244528",
"0.52439773",
"0.51998705",
"0.51625687",
"0.51065147",
"0.5037964",
"0.5025813",
"0.50085735",
"0.49989513",
"0.49833488",
"0.4976266",
"0.489791",
"0.48751837",
"0.4870189",
"0.48700786"
] | 0.7410611 | 0 |
Create request for operation 'updateCloudBucket' | protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)
{
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'
);
}
// verify the required parameter 'cloud_bucket_body' is set
if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'
);
}
$resourcePath = '/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($cloud_bucket_body)) {
$_tempBody = $cloud_bucket_body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function putBucket($bucketName);",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }",
"static function changeBucket ($oldBucketId, $newBucketName, $clientId, $template, $database)\n\t{\n\n\t\tif ( empty($newBucketName) )\n\t\t{\n\t\t\treturn;\t\n\t\t}\n\t\t// See if there is a bucket with that name already\n\t\t$bucketId = 0;\n\t\t$bucketIdRes = self::searchClientBucketsByBucketName($newBucketName, $clientId, $database);\n\t\t$bucketIdRow = $database->fetchRow($bucketIdRes);\t\n\t\t$bucketId = $bucketIdRow['BUCKET_ID'];\n\t\t\n\t\t// If the bucket already exists AND\n\t\t// we are not changing from a default bucket name\n\t\t// then errors\n\t\tif( $bucketId > 0 && $oldBucketId != 1 && strtolower($newBucketName) != strtolower('Untagged'))\n\t\t{\n\t\t\t// A bucket already exists with that name\n\t\t\t$template->parse(\"MESSAGE\",\"Oops, you already have a bucket with that name\");\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Changing from a default bucket\n\t\tif( $oldBucketId == 1)\n\t\t{\n\t\t\t// If a bucket does not exists with that name\n\t\t\t// we need to create a new Bucket\n\t\t\tif( $bucketId <= 0)\n\t\t\t{\n\t\t\t\t// Create a new bucket\n\t\t\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\t\t(CLIENT_ID, BUCKET_NAME)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('$clientId','$newBucketName')\"; \n\t\t\t\t$res = $database->query($sql);\n\t\t\t\t$bucketId = $database->getLastId();\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// Changing from a NON default bucket\n\t\telse\n\t\t{\t\t\t\n\t\t\t// If user is trying to change the name to\n\t\t\t// untagged (default) again then we will\n\t\t\t// keep the bucket name around but will move the\n\t\t\t// services to the untagged (default) bucket\n\t\t\t// Otherwise we update de bucket name here\n\t\t\tif ( strtolower($newBucketName) == strtolower('Untagged') )\n\t\t\t{\n\t\t\t\t$bucketId = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We just change the name of the bucket\n\t\t\t\t$sql = \"UPDATE\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\tSET \n\t\t\t\t\t\t\tBUCKET_NAME = '$newBucketName'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\t\t$bucketId = $oldBucketId;\n\t\t\t\t\n\t\t\t\t$res = $database->query($sql);\t\n\n\t\t\t}\t\t\t\n\t\n\t\t}\n\n\t\t// Move all the services to the \n\t\t// new assigned bucket which could be\n\t\t// an exising bucket or a new one\n\t\t$sql = \"UPDATE\n\t\t\t\t\tCLIENT_SERVICE_BUCKET\n\t\t\t\tSET \n\t\t\t\t\tBUCKET_ID = $bucketId\n\t\t\t\tWHERE\n\t\t\t\t\tCLIENT_ID = $clientId\n\t\t\t\tAND\n\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\n\t\t$res = $database->query($sql);\n\t\t\n\t\t$template->parse(\"MESSAGE\",\"\");\n\t\t\n\t}",
"public function putObject($bucketName, $input, $uri);",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"public function setBucket($bucket, $data) {\n if (!in_array($bucket, array('global', 'local')))\n throw new \\InvalidArgumentException('Bucket type must be \"global\" or \"local\"');\n\n $this->buckets[$bucket] = $data;\n return true;\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function putObject($ossClient,$bucket){\n\t$object = \"b.file\";\n\t$options = array(\n\t\tOssClient::OSS_HEADERS => array(\n\t\t\t'x-oss-tagging' => 'key1=value1&key2=value2&key3=value3',\n\t\t));\n\ttry {\n\t\t// 通过简单上传的方式上传Object。\n\t\t$result = $ossClient->putObject($bucket, $object, __FILE__,$options);\n\t\tCommon::println(\"b.file is created\".PHP_EOL);\n\t\tCommon::println(\"tag is:\".$result['oss-requestheaders']['x-oss-tagging'].PHP_EOL);\n\t} catch (OssException $e) {\n\t\tprintf(__FUNCTION__ . \": FAILED\\n\");\n\t\tprintf($e->getMessage() . \"\\n\");\n\t\treturn;\n\t}\n\t\n\tprint(__FUNCTION__ . \": OK\" . \"\\n\");\n}",
"abstract public function append($bucket, $name, $data);",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"protected function putRequest($command, $params = array()) {\n\n $this->prepareCommand($command, $params);\n\n if ($this->getToken()) {\n $this->curl->setHeader('Authorization', 'Bearer ' . $this->getToken());\n }\n\n $this->curl->put(ZENCI_GOOGLE_CE_API_URI . '/' . $this->project_id . '/' . $command, $params);\n $response = $this->getResponse();\n return $response;\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testUpdateOrderItemUsingPUT()\n {\n }",
"public function _put($url = null, array $parameter = []);",
"public function setBucketProperties($name, array $props)\n {\n $properties = new RpbBucketProps();\n if (isset($props['allow_mult'])) {\n $properties->setAllowMult($props['allow_mult']);\n }\n if (isset($props['n_val'])) {\n $properties->setNVal($props['n_val']);\n }\n $req = new $this->_classMap[self::MSG_CODE_SET_BUCKET_REQ]();\n $req->setBucket($name);\n $req->setProps($properties);\t \n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_SET_BUCKET_REQ));\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_SET_BUCKET_RESP) {\n return true;\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode);\n }\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setBucket($bucket)\n {\n return $this->setOption('Bucket', $bucket);\n }",
"abstract public function write($bucket, $name, $data);",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCartRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling updateCart'\n );\n }\n\n $resourcePath = '/beta/cart';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function bucket($query/*String*/, $bucketField/*String*/, array $queryParams/*array(String=>String)*/){\n\t\t$this->query = $query;\n\t\t$this->queryParams = $queryParams;\n\t\t$this->bucketField = $bucketField;\n\t\t\n\t\treturn $this;\n\t}"
] | [
"0.6711993",
"0.6525744",
"0.6090094",
"0.60029423",
"0.5845722",
"0.57814705",
"0.5730656",
"0.5707928",
"0.5650818",
"0.5565963",
"0.5553346",
"0.55279964",
"0.5511056",
"0.5500537",
"0.54171044",
"0.53854823",
"0.53032386",
"0.5293713",
"0.5268349",
"0.5230523",
"0.52117985",
"0.5177659",
"0.51144415",
"0.5104083",
"0.50951874",
"0.5090585",
"0.50789994",
"0.5069264",
"0.50658345",
"0.5051863"
] | 0.72965443 | 0 |
Operation updateCloudBucketByCloudConnectorAsync Updates a specific cloud bucket. | public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)
{
return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function UpdateAppConnector(\\Google\\Cloud\\BeyondCorp\\AppConnectors\\V1\\UpdateAppConnectorRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.beyondcorp.appconnectors.v1.AppConnectorsService/UpdateAppConnector',\n $argument,\n ['\\Google\\LongRunning\\Operation', 'decode'],\n $metadata, $options);\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncResultCloudBucketsAsync($cloud_connector_id, $job_id)\n {\n return $this->syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateApplicationUsingPutAsync($application, $application_id)\n {\n return $this->updateApplicationUsingPutAsyncWithHttpInfo($application, $application_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateZoneSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n return $this->updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.6116758",
"0.60565454",
"0.57976604",
"0.555009",
"0.5508743",
"0.5195243",
"0.517804",
"0.51531696",
"0.50452965",
"0.501646",
"0.49944595",
"0.49087837",
"0.48732194",
"0.4796233",
"0.47708568",
"0.46849936",
"0.46746752",
"0.46446514",
"0.45646203",
"0.45627278",
"0.4531034",
"0.44068938",
"0.43889785",
"0.43243667",
"0.42984992",
"0.4278941",
"0.42736945",
"0.42678446",
"0.42054877",
"0.41019875"
] | 0.67530924 | 0 |
Operation updateCloudBucketByCloudConnectorAsyncWithHttpInfo Updates a specific cloud bucket. | public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnector($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBuckets($cloud_connector_id)\n {\n list($response) = $this->syncCloudBucketsWithHttpInfo($cloud_connector_id);\n return $response;\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function updateApplicationUsingPutAsyncWithHttpInfo($application, $application_id)\n {\n $returnType = '\\com\\hydrogen\\nucleus\\Model\\Application';\n $request = $this->updateApplicationUsingPutRequest($application, $application_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsync($cloud_connector_id)\n {\n return $this->syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateAisleCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateAisleCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function contactsEmailPutAsyncWithHttpInfo($email, $body)\n {\n $returnType = '\\Swagger\\Client\\Model\\Contact';\n $request = $this->contactsEmailPutRequest($email, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateWarehouseServiceTypeCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateWarehouseServiceTypeCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBuckets($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n return $response;\n }",
"public function indexCloudBucketsWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function putTranscoderConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderConfigRequest($server_name, $vhost_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.6327988",
"0.59700286",
"0.5763043",
"0.5708295",
"0.5644014",
"0.5384244",
"0.5318649",
"0.53115284",
"0.5267741",
"0.5228958",
"0.51426893",
"0.5072389",
"0.50592893",
"0.50072026",
"0.48908904",
"0.48572084",
"0.4743147",
"0.4721376",
"0.46923766",
"0.46850446",
"0.46826196",
"0.46219",
"0.46182042",
"0.4597313",
"0.4514404",
"0.44783998",
"0.4420638",
"0.44112313",
"0.44031724",
"0.4402787"
] | 0.69814175 | 0 |
Create request for operation 'updateCloudBucketByCloudConnector' | protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)
{
// verify the required parameter 'cloud_connector_id' is set
if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'
);
}
// verify the required parameter 'cloud_bucket_body' is set
if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'
);
}
$resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_connector_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_connector_id' . '}',
ObjectSerializer::toPathValue($cloud_connector_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($cloud_bucket_body)) {
$_tempBody = $cloud_bucket_body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function putBucket($bucketName);",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function putObject($bucketName, $input, $uri);",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function syncCloudBucketsWithHttpInfo($cloud_connector_id)\n {\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }",
"public function deleteBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->deleteBucket($awsS3);\n\n return new Response($result);\n }",
"public function setBucket($bucket, $data) {\n if (!in_array($bucket, array('global', 'local')))\n throw new \\InvalidArgumentException('Bucket type must be \"global\" or \"local\"');\n\n $this->buckets[$bucket] = $data;\n return true;\n }",
"public function _put($url = null, array $parameter = []);",
"public function testUpdateOfferUsingPUT()\n {\n }",
"public function syncResultCloudBucketsWithHttpInfo($cloud_connector_id, $job_id)\n {\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n case 202:\n if ('\\NodeumSDK\\Client\\Model\\ActiveJobStatus' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\ActiveJobStatus', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n case 202:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\ActiveJobStatus',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function setBucket($bucket)\n {\n return $this->setOption('Bucket', $bucket);\n }",
"protected function quotesV2PutRequest($body, $id)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling quotesV2Put'\n );\n }\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling quotesV2Put'\n );\n }\n\n $resourcePath = '/v2/quotes/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // form params\n if ($id !== null) {\n $formParams['Id'] = ObjectSerializer::toFormValue($id);\n }\n // form params\n if ($number !== null) {\n $formParams['Number'] = ObjectSerializer::toFormValue($number);\n }\n // form params\n if ($customer_id !== null) {\n $formParams['CustomerId'] = ObjectSerializer::toFormValue($customer_id);\n }\n // form params\n if ($due_date !== null) {\n $formParams['DueDate'] = ObjectSerializer::toFormValue($due_date);\n }\n // form params\n if ($quote_date !== null) {\n $formParams['QuoteDate'] = ObjectSerializer::toFormValue($quote_date);\n }\n // form params\n if ($created_utc !== null) {\n $formParams['CreatedUtc'] = ObjectSerializer::toFormValue($created_utc);\n }\n // form params\n if ($approved_date !== null) {\n $formParams['ApprovedDate'] = ObjectSerializer::toFormValue($approved_date);\n }\n // form params\n if ($currency_code !== null) {\n $formParams['CurrencyCode'] = ObjectSerializer::toFormValue($currency_code);\n }\n // form params\n if ($status !== null) {\n $formParams['Status'] = ObjectSerializer::toFormValue($status);\n }\n // form params\n if ($currency_rate !== null) {\n $formParams['CurrencyRate'] = ObjectSerializer::toFormValue($currency_rate);\n }\n // form params\n if ($company_reference !== null) {\n $formParams['CompanyReference'] = ObjectSerializer::toFormValue($company_reference);\n }\n // form params\n if ($eu_third_party !== null) {\n $formParams['EuThirdParty'] = ObjectSerializer::toFormValue($eu_third_party);\n }\n // form params\n if ($customer_reference !== null) {\n $formParams['CustomerReference'] = ObjectSerializer::toFormValue($customer_reference);\n }\n // form params\n if ($invoice_customer_name !== null) {\n $formParams['InvoiceCustomerName'] = ObjectSerializer::toFormValue($invoice_customer_name);\n }\n // form params\n if ($invoice_address1 !== null) {\n $formParams['InvoiceAddress1'] = ObjectSerializer::toFormValue($invoice_address1);\n }\n // form params\n if ($invoice_address2 !== null) {\n $formParams['InvoiceAddress2'] = ObjectSerializer::toFormValue($invoice_address2);\n }\n // form params\n if ($invoice_postal_code !== null) {\n $formParams['InvoicePostalCode'] = ObjectSerializer::toFormValue($invoice_postal_code);\n }\n // form params\n if ($invoice_city !== null) {\n $formParams['InvoiceCity'] = ObjectSerializer::toFormValue($invoice_city);\n }\n // form params\n if ($invoice_country_code !== null) {\n $formParams['InvoiceCountryCode'] = ObjectSerializer::toFormValue($invoice_country_code);\n }\n // form params\n if ($delivery_customer_name !== null) {\n $formParams['DeliveryCustomerName'] = ObjectSerializer::toFormValue($delivery_customer_name);\n }\n // form params\n if ($delivery_address1 !== null) {\n $formParams['DeliveryAddress1'] = ObjectSerializer::toFormValue($delivery_address1);\n }\n // form params\n if ($delivery_address2 !== null) {\n $formParams['DeliveryAddress2'] = ObjectSerializer::toFormValue($delivery_address2);\n }\n // form params\n if ($delivery_postal_code !== null) {\n $formParams['DeliveryPostalCode'] = ObjectSerializer::toFormValue($delivery_postal_code);\n }\n // form params\n if ($delivery_city !== null) {\n $formParams['DeliveryCity'] = ObjectSerializer::toFormValue($delivery_city);\n }\n // form params\n if ($delivery_country_code !== null) {\n $formParams['DeliveryCountryCode'] = ObjectSerializer::toFormValue($delivery_country_code);\n }\n // form params\n if ($delivery_method_name !== null) {\n $formParams['DeliveryMethodName'] = ObjectSerializer::toFormValue($delivery_method_name);\n }\n // form params\n if ($delivery_method_code !== null) {\n $formParams['DeliveryMethodCode'] = ObjectSerializer::toFormValue($delivery_method_code);\n }\n // form params\n if ($delivery_term_code !== null) {\n $formParams['DeliveryTermCode'] = ObjectSerializer::toFormValue($delivery_term_code);\n }\n // form params\n if ($delivery_term_name !== null) {\n $formParams['DeliveryTermName'] = ObjectSerializer::toFormValue($delivery_term_name);\n }\n // form params\n if ($customer_is_private_person !== null) {\n $formParams['CustomerIsPrivatePerson'] = ObjectSerializer::toFormValue($customer_is_private_person);\n }\n // form params\n if ($includes_vat !== null) {\n $formParams['IncludesVat'] = ObjectSerializer::toFormValue($includes_vat);\n }\n // form params\n if ($is_domestic !== null) {\n $formParams['IsDomestic'] = ObjectSerializer::toFormValue($is_domestic);\n }\n // form params\n if ($rot_reduced_invoicing_type !== null) {\n $formParams['RotReducedInvoicingType'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_type);\n }\n // form params\n if ($rot_property_type !== null) {\n $formParams['RotPropertyType'] = ObjectSerializer::toFormValue($rot_property_type);\n }\n // form params\n if ($rot_reduced_invoicing_property_name !== null) {\n $formParams['RotReducedInvoicingPropertyName'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_property_name);\n }\n // form params\n if ($rot_reduced_invoicing_org_number !== null) {\n $formParams['RotReducedInvoicingOrgNumber'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_org_number);\n }\n // form params\n if ($rot_reduced_invoicing_amount !== null) {\n $formParams['RotReducedInvoicingAmount'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_amount);\n }\n // form params\n if ($rot_reduced_invoicing_automatic_distribution !== null) {\n $formParams['RotReducedInvoicingAutomaticDistribution'] = ObjectSerializer::toFormValue($rot_reduced_invoicing_automatic_distribution);\n }\n // form params\n if ($persons !== null) {\n $formParams['Persons'] = ObjectSerializer::toFormValue($persons);\n }\n // form params\n if ($terms_of_payment !== null) {\n $formParams['TermsOfPayment'] = ObjectSerializer::toFormValue($terms_of_payment);\n }\n // form params\n if ($sales_document_attachments !== null) {\n $formParams['SalesDocumentAttachments'] = ObjectSerializer::toFormValue($sales_document_attachments);\n }\n // form params\n if ($rows !== null) {\n $formParams['Rows'] = ObjectSerializer::toFormValue($rows);\n }\n // form params\n if ($total_amount !== null) {\n $formParams['TotalAmount'] = ObjectSerializer::toFormValue($total_amount);\n }\n // form params\n if ($vat_amount !== null) {\n $formParams['VatAmount'] = ObjectSerializer::toFormValue($vat_amount);\n }\n // form params\n if ($roundings_amount !== null) {\n $formParams['RoundingsAmount'] = ObjectSerializer::toFormValue($roundings_amount);\n }\n // form params\n if ($uses_green_technology !== null) {\n $formParams['UsesGreenTechnology'] = ObjectSerializer::toFormValue($uses_green_technology);\n }\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"static function changeBucket ($oldBucketId, $newBucketName, $clientId, $template, $database)\n\t{\n\n\t\tif ( empty($newBucketName) )\n\t\t{\n\t\t\treturn;\t\n\t\t}\n\t\t// See if there is a bucket with that name already\n\t\t$bucketId = 0;\n\t\t$bucketIdRes = self::searchClientBucketsByBucketName($newBucketName, $clientId, $database);\n\t\t$bucketIdRow = $database->fetchRow($bucketIdRes);\t\n\t\t$bucketId = $bucketIdRow['BUCKET_ID'];\n\t\t\n\t\t// If the bucket already exists AND\n\t\t// we are not changing from a default bucket name\n\t\t// then errors\n\t\tif( $bucketId > 0 && $oldBucketId != 1 && strtolower($newBucketName) != strtolower('Untagged'))\n\t\t{\n\t\t\t// A bucket already exists with that name\n\t\t\t$template->parse(\"MESSAGE\",\"Oops, you already have a bucket with that name\");\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Changing from a default bucket\n\t\tif( $oldBucketId == 1)\n\t\t{\n\t\t\t// If a bucket does not exists with that name\n\t\t\t// we need to create a new Bucket\n\t\t\tif( $bucketId <= 0)\n\t\t\t{\n\t\t\t\t// Create a new bucket\n\t\t\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\t\t(CLIENT_ID, BUCKET_NAME)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('$clientId','$newBucketName')\"; \n\t\t\t\t$res = $database->query($sql);\n\t\t\t\t$bucketId = $database->getLastId();\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// Changing from a NON default bucket\n\t\telse\n\t\t{\t\t\t\n\t\t\t// If user is trying to change the name to\n\t\t\t// untagged (default) again then we will\n\t\t\t// keep the bucket name around but will move the\n\t\t\t// services to the untagged (default) bucket\n\t\t\t// Otherwise we update de bucket name here\n\t\t\tif ( strtolower($newBucketName) == strtolower('Untagged') )\n\t\t\t{\n\t\t\t\t$bucketId = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We just change the name of the bucket\n\t\t\t\t$sql = \"UPDATE\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\tSET \n\t\t\t\t\t\t\tBUCKET_NAME = '$newBucketName'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\t\t$bucketId = $oldBucketId;\n\t\t\t\t\n\t\t\t\t$res = $database->query($sql);\t\n\n\t\t\t}\t\t\t\n\t\n\t\t}\n\n\t\t// Move all the services to the \n\t\t// new assigned bucket which could be\n\t\t// an exising bucket or a new one\n\t\t$sql = \"UPDATE\n\t\t\t\t\tCLIENT_SERVICE_BUCKET\n\t\t\t\tSET \n\t\t\t\t\tBUCKET_ID = $bucketId\n\t\t\t\tWHERE\n\t\t\t\t\tCLIENT_ID = $clientId\n\t\t\t\tAND\n\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\n\t\t$res = $database->query($sql);\n\t\t\n\t\t$template->parse(\"MESSAGE\",\"\");\n\t\t\n\t}",
"function putObject($ossClient,$bucket){\n\t$object = \"b.file\";\n\t$options = array(\n\t\tOssClient::OSS_HEADERS => array(\n\t\t\t'x-oss-tagging' => 'key1=value1&key2=value2&key3=value3',\n\t\t));\n\ttry {\n\t\t// 通过简单上传的方式上传Object。\n\t\t$result = $ossClient->putObject($bucket, $object, __FILE__,$options);\n\t\tCommon::println(\"b.file is created\".PHP_EOL);\n\t\tCommon::println(\"tag is:\".$result['oss-requestheaders']['x-oss-tagging'].PHP_EOL);\n\t} catch (OssException $e) {\n\t\tprintf(__FUNCTION__ . \": FAILED\\n\");\n\t\tprintf($e->getMessage() . \"\\n\");\n\t\treturn;\n\t}\n\t\n\tprint(__FUNCTION__ . \": OK\" . \"\\n\");\n}",
"public function update(Request $request, price_bands $price_bands)\n {\n //\n }"
] | [
"0.6720413",
"0.6424474",
"0.62508076",
"0.6201313",
"0.5878089",
"0.5644223",
"0.5587828",
"0.5385228",
"0.5382483",
"0.5358751",
"0.531983",
"0.5222502",
"0.5188158",
"0.5149481",
"0.5068795",
"0.50681996",
"0.4987286",
"0.49852178",
"0.4937321",
"0.49367243",
"0.49222898",
"0.4874692",
"0.48197263",
"0.48027903",
"0.47638875",
"0.4702616",
"0.46999034",
"0.4687623",
"0.46812105",
"0.46668425"
] | 0.730152 | 0 |
Operation updateCloudBucketByPoolAsync Updates a specific cloud bucket. | public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)
{
return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function updateSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateLayerAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateLayerAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCouponBatchAsync($applicationId, $campaignId, $body)\n {\n return $this->updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCouponAsync($applicationId, $campaignId, $couponId, $body)\n {\n return $this->updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSystemAsync($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n {\n return $this->updateSystemAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateZoneSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n return $this->updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body)\n {\n $returnType = '';\n $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | [
"0.62324375",
"0.59835505",
"0.5227429",
"0.52097636",
"0.51731235",
"0.5121468",
"0.503093",
"0.49126866",
"0.48824823",
"0.48699957",
"0.48635104",
"0.4786689",
"0.47337884",
"0.47291175",
"0.472562",
"0.47044012",
"0.45376793",
"0.45086366",
"0.44874105",
"0.44296488",
"0.44070545",
"0.43536925",
"0.43080786",
"0.4223929",
"0.42113802",
"0.42084092",
"0.41810343",
"0.4179537",
"0.4150762",
"0.4141532"
] | 0.6234279 | 0 |
Operation updateCloudBucketByPoolAsyncWithHttpInfo Updates a specific cloud bucket. | public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)
{
$returnType = '\NodeumSDK\Client\Model\CloudBucket';
$request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolAsync($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCouponBatchAsyncWithHttpInfo($applicationId, $campaignId, $body)\n {\n $returnType = '';\n $request = $this->updateCouponBatchRequest($applicationId, $campaignId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCouponAsyncWithHttpInfo($applicationId, $campaignId, $couponId, $body)\n {\n $returnType = '\\TalonOne\\Client\\Model\\Coupon';\n $request = $this->updateCouponRequest($applicationId, $campaignId, $couponId, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\NodeumFileCollection';\n $request = $this->indexFilesByPoolRequest($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function mountStatusCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->mountStatusCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByPoolAsync($pool_id, $cloud_bucket_id)\n {\n return $this->showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexCloudBucketsAsync($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsAsyncWithHttpInfo($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updatePoolServerAsyncWithHttpInfo($options)\n {\n $returnType = '\\Fastly\\Model\\ServerResponse';\n $request = $this->updatePoolServerRequest($options);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function indexOnTapesFilesByPoolAsyncWithHttpInfo($pool_id, $limit = null, $offset = null, $name = null, $type = null, $size = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\OnTapesFileCollection';\n $request = $this->indexOnTapesFilesByPoolRequest($pool_id, $limit, $offset, $name, $type, $size);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateNetworkCellularGatewaySubnetPoolAsyncWithHttpInfo($network_id, $update_network_cellular_gateway_subnet_pool = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkCellularGatewaySubnetPoolRequest($network_id, $update_network_cellular_gateway_subnet_pool);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsync($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n return $this->indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\Space';\n $request = $this->updateSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function updateSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function indexFilesByPoolAsync($pool_id, $limit = null, $offset = null, $file_id = null, $name = null, $type = null, $permission = null, $size = null, $change_date = null, $modification_date = null, $access_date = null, $gid = null, $uid = null)\n {\n return $this->indexFilesByPoolAsyncWithHttpInfo($pool_id, $limit, $offset, $file_id, $name, $type, $permission, $size, $change_date, $modification_date, $access_date, $gid, $uid)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.6333132",
"0.6073951",
"0.59803766",
"0.57763815",
"0.5720805",
"0.5698651",
"0.5554752",
"0.5485583",
"0.54012024",
"0.53094494",
"0.5221102",
"0.52086794",
"0.5201097",
"0.5111671",
"0.49966452",
"0.49664953",
"0.48515782",
"0.47951886",
"0.47876292",
"0.47740266",
"0.46920806",
"0.46800116",
"0.4673987",
"0.4671838",
"0.46577907",
"0.4640921",
"0.46289352",
"0.46086496",
"0.45898438",
"0.45718005"
] | 0.71471405 | 0 |
Create request for operation 'updateCloudBucketByPool' | protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)
{
// verify the required parameter 'pool_id' is set
if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $pool_id when calling updateCloudBucketByPool'
);
}
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'
);
}
// verify the required parameter 'cloud_bucket_body' is set
if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'
);
}
$resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($pool_id !== null) {
$resourcePath = str_replace(
'{' . 'pool_id' . '}',
ObjectSerializer::toPathValue($pool_id),
$resourcePath
);
}
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if (isset($cloud_bucket_body)) {
$_tempBody = $cloud_bucket_body;
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function mountStatusCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling mountStatusCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByPoolRequest($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling indexCloudBucketsByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsRequest($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n\n $resourcePath = '/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($cloud_connector_id)) {\n $cloud_connector_id = ObjectSerializer::serializeCollection($cloud_connector_id, '', true);\n }\n if ($cloud_connector_id !== null) {\n $queryParams['cloud_connector_id'] = $cloud_connector_id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling indexCloudBucketsByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($limit)) {\n $limit = ObjectSerializer::serializeCollection($limit, '', true);\n }\n if ($limit !== null) {\n $queryParams['limit'] = $limit;\n }\n // query params\n if (is_array($offset)) {\n $offset = ObjectSerializer::serializeCollection($offset, '', true);\n }\n if ($offset !== null) {\n $queryParams['offset'] = $offset;\n }\n // query params\n if (is_array($sort_by)) {\n $sort_by = ObjectSerializer::serializeCollection($sort_by, 'pipeDelimited', true);\n }\n if ($sort_by !== null) {\n $queryParams['sort_by'] = $sort_by;\n }\n // query params\n if (is_array($id)) {\n $id = ObjectSerializer::serializeCollection($id, '', true);\n }\n if ($id !== null) {\n $queryParams['id'] = $id;\n }\n // query params\n if (is_array($pool_id)) {\n $pool_id = ObjectSerializer::serializeCollection($pool_id, '', true);\n }\n if ($pool_id !== null) {\n $queryParams['pool_id'] = $pool_id;\n }\n // query params\n if (is_array($name)) {\n $name = ObjectSerializer::serializeCollection($name, '', true);\n }\n if ($name !== null) {\n $queryParams['name'] = $name;\n }\n // query params\n if (is_array($location)) {\n $location = ObjectSerializer::serializeCollection($location, '', true);\n }\n if ($location !== null) {\n $queryParams['location'] = $location;\n }\n // query params\n if (is_array($price)) {\n $price = ObjectSerializer::serializeCollection($price, '', true);\n }\n if ($price !== null) {\n $queryParams['price'] = $price;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function update(Request $request, price_bands $price_bands)\n {\n //\n }",
"public function indexCloudBucketsByPool($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n list($response) = $this->indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n return $response;\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updatePublicIpAddressPoolAttributeWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->clientToken)) {\n $query['ClientToken'] = $request->clientToken;\n }\n if (!Utils::isUnset($request->description)) {\n $query['Description'] = $request->description;\n }\n if (!Utils::isUnset($request->dryRun)) {\n $query['DryRun'] = $request->dryRun;\n }\n if (!Utils::isUnset($request->name)) {\n $query['Name'] = $request->name;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->publicIpAddressPoolId)) {\n $query['PublicIpAddressPoolId'] = $request->publicIpAddressPoolId;\n }\n if (!Utils::isUnset($request->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'UpdatePublicIpAddressPoolAttribute',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return UpdatePublicIpAddressPoolAttributeResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function updatePoolServerRequest($options)\n {\n // unbox the parameters from the associative array\n $service_id = array_key_exists('service_id', $options) ? $options['service_id'] : null;\n $pool_id = array_key_exists('pool_id', $options) ? $options['pool_id'] : null;\n $server_id = array_key_exists('server_id', $options) ? $options['server_id'] : null;\n $weight = array_key_exists('weight', $options) ? $options['weight'] : 100;\n $max_conn = array_key_exists('max_conn', $options) ? $options['max_conn'] : 0;\n $port = array_key_exists('port', $options) ? $options['port'] : 80;\n $address = array_key_exists('address', $options) ? $options['address'] : null;\n $comment = array_key_exists('comment', $options) ? $options['comment'] : null;\n $disabled = array_key_exists('disabled', $options) ? $options['disabled'] : false;\n $override_host = array_key_exists('override_host', $options) ? $options['override_host'] : 'null';\n\n // verify the required parameter 'service_id' is set\n if ($service_id === null || (is_array($service_id) && count($service_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $service_id when calling updatePoolServer'\n );\n }\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updatePoolServer'\n );\n }\n // verify the required parameter 'server_id' is set\n if ($server_id === null || (is_array($server_id) && count($server_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_id when calling updatePoolServer'\n );\n }\n if ($weight !== null && $weight > 100) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.updatePoolServer, must be smaller than or equal to 100.');\n }\n if ($weight !== null && $weight < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$weight\" when calling ServerApi.updatePoolServer, must be bigger than or equal to 1.');\n }\n\n\n $resourcePath = '/service/{service_id}/pool/{pool_id}/server/{server_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($service_id !== null) {\n $resourcePath = str_replace(\n '{' . 'service_id' . '}',\n ObjectSerializer::toPathValue($service_id),\n $resourcePath\n );\n }\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($server_id !== null) {\n $resourcePath = str_replace(\n '{' . 'server_id' . '}',\n ObjectSerializer::toPathValue($server_id),\n $resourcePath\n );\n }\n\n // form params\n if ($weight !== null) {\n $formParams['weight'] = ObjectSerializer::toFormValue($weight);\n }\n // form params\n if ($max_conn !== null) {\n $formParams['max_conn'] = ObjectSerializer::toFormValue($max_conn);\n }\n // form params\n if ($port !== null) {\n $formParams['port'] = ObjectSerializer::toFormValue($port);\n }\n // form params\n if ($address !== null) {\n $formParams['address'] = ObjectSerializer::toFormValue($address);\n }\n // form params\n if ($comment !== null) {\n $formParams['comment'] = ObjectSerializer::toFormValue($comment);\n }\n // form params\n if ($disabled !== null) {\n $formParams['disabled'] = ObjectSerializer::toFormValue($disabled);\n }\n // form params\n if ($override_host !== null) {\n $formParams['override_host'] = ObjectSerializer::toFormValue($override_host);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateBucket(Bucket $bucket) {\n\t\t$bucketContainer = new BucketContainer($this->getBucketContainerId($bucket), $this->connector);\n\n\t\t// The basic information about the task.\n\t\t$bucketContainer->setUserId($bucket->getUserId());\n\t\t$bucketContainer->setState($bucket->getState());\n\t\t$bucketContainer->setTotalNumberoftasks(count($bucket->getTask()->unfoldTask()));\n\t\t$bucketContainer->setPercentage($bucket->getOverallPercentage());\n\t\t$bucketContainer->setTitle($bucket->getTitle());\n\t\t$bucketContainer->setLastHeartbeat($bucket->getLastHeartbeat());\n\t\t$bucketContainer->setDescription($bucket->getDescription());\n\t\t$bucketContainer->setCurrentTaskid($this->getTaskContainerId($bucket->getCurrentTask()));\n\t\t$bucketContainer->setRootTaskid($this->getTaskContainerId($bucket->getTask()));\n\n\t\t// Save and store the container to bucket instance.\n\t\t$bucketContainer->update();\n\t}",
"public function putBucket($bucketName);",
"public function update(Request $request, Swimmingpool $swimmingpool)\n {\n $swimmingpool->update($request->only(['name', 'location','length','type']));\n return new SwimmingpoolResource($swimmingpool);\n }",
"public function putObject($bucketName, $input, $uri);",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateNetworkCellularGatewaySubnetPoolRequest($network_id, $update_network_cellular_gateway_subnet_pool = null)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling updateNetworkCellularGatewaySubnetPool'\n );\n }\n\n $resourcePath = '/networks/{networkId}/cellularGateway/subnetPool';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($update_network_cellular_gateway_subnet_pool)) {\n $_tempBody = $update_network_cellular_gateway_subnet_pool;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setBucket($bucket, $data) {\n if (!in_array($bucket, array('global', 'local')))\n throw new \\InvalidArgumentException('Bucket type must be \"global\" or \"local\"');\n\n $this->buckets[$bucket] = $data;\n return true;\n }",
"public function indexCloudBucketsByPoolWithHttpInfo($pool_id, $limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $name = null, $location = null, $price = null)\n {\n $request = $this->indexCloudBucketsByPoolRequest($pool_id, $limit, $offset, $sort_by, $id, $cloud_connector_id, $name, $location, $price);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n switch($statusCode) {\n case 200:\n if ('\\NodeumSDK\\Client\\Model\\CloudBucketCollection' === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, '\\NodeumSDK\\Client\\Model\\CloudBucketCollection', []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n }\n\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\NodeumSDK\\Client\\Model\\CloudBucketCollection',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"public function updatePublicIpAddressPoolAttribute($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->updatePublicIpAddressPoolAttributeWithOptions($request, $runtime);\n }",
"public function update(BucketUpdateRequest $request, Bucket $bucket)\n {\n $bucket->update($request->all());\n $bucket->resources()->sync($request->get('resources'));\n\n flash('Bucket was updated');\n\n return redirect('/buckets');\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"abstract public function append($bucket, $name, $data);",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function update(Request $request, Bid $bid)\n {\n //\n }"
] | [
"0.65346724",
"0.5905755",
"0.5833038",
"0.56909883",
"0.5544676",
"0.53270066",
"0.5137167",
"0.50297344",
"0.49771875",
"0.49643946",
"0.49227443",
"0.4892417",
"0.48124677",
"0.47629285",
"0.4744001",
"0.47331846",
"0.47091097",
"0.4623494",
"0.45747495",
"0.4563605",
"0.45562503",
"0.45415655",
"0.4535069",
"0.45337278",
"0.44377536",
"0.44286856",
"0.44084978",
"0.4354741",
"0.435049",
"0.43344587"
] | 0.7368595 | 0 |
Operation updateConfigFileCloudBucketAsync Updates a specific cloud bucket. | public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)
{
return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)
->then(
function ($response) {
return $response[0];
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateRadiusConfigAsync($body, $x_sds_auth_token = null)\n {\n return $this->updateRadiusConfigAsyncWithHttpInfo($body, $x_sds_auth_token)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putStreamFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n {\n $returnType = '';\n $request = $this->putStreamFileConfigRequest($server_name, $vhost_name, $streamfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putSMILFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $smilfile_name, $body)\n {\n $returnType = '';\n $request = $this->putSMILFileConfigRequest($server_name, $vhost_name, $smilfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putStreamFileConfigAsync($server_name, $vhost_name, $streamfile_name, $body)\n {\n return $this->putStreamFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function putSMILFileConfigAsync($server_name, $vhost_name, $smilfile_name, $body)\n {\n return $this->putSMILFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $smilfile_name, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putStreamFileConfigAdvAsync($server_name, $vhost_name, $streamfile_name, $body)\n {\n return $this->putStreamFileConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateSystemAsync($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n {\n return $this->updateSystemAsyncWithHttpInfo($cloud_pk, $ifc_pk, $project_pk, $uuid, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateLayerAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateLayerAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putTranscoderConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderConfigRequest($server_name, $vhost_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateRadiusConfigAsyncWithHttpInfo($body, $x_sds_auth_token = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\RadiusConfig';\n $request = $this->updateRadiusConfigRequest($body, $x_sds_auth_token);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderTemplateConfigAsync($server_name, $vhost_name, $template_name, $body)\n {\n return $this->putTranscoderTemplateConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateZoneSpaceAsync($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n return $this->updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putStreamFileConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n {\n $returnType = '';\n $request = $this->putStreamFileConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateIfcAsync($cloud_pk, $id, $project_pk, $data)\n {\n return $this->updateIfcAsyncWithHttpInfo($cloud_pk, $id, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putTranscoderTemplateConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderTemplateConfigRequest($server_name, $vhost_name, $template_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderConfigAsync($server_name, $vhost_name, $body)\n {\n return $this->putTranscoderConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateZoneAsync($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n {\n return $this->updateZoneAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putTranscoderStreamNameGroupConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $group_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderStreamNameGroupConfigRequest($server_name, $vhost_name, $template_name, $group_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function systemConfigurationUpdateAsync($system_configuration)\n {\n return $this->systemConfigurationUpdateAsyncWithHttpInfo($system_configuration)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | [
"0.68486905",
"0.5745021",
"0.56699145",
"0.5566769",
"0.5504089",
"0.54041594",
"0.51716316",
"0.50353426",
"0.48668632",
"0.46634558",
"0.46565863",
"0.46222055",
"0.4607285",
"0.45676172",
"0.45407465",
"0.4540412",
"0.4484843",
"0.4456567",
"0.4423163",
"0.43921354",
"0.43919858",
"0.43919224",
"0.43774337",
"0.43774214",
"0.43698224",
"0.43608683",
"0.43310767",
"0.4317932",
"0.42991492",
"0.42946717"
] | 0.7410197 | 0 |
Operation updateConfigFileCloudBucketAsyncWithHttpInfo Updates a specific cloud bucket. | public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)
{
$returnType = 'string';
$request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);
return $this->client
->sendAsync($request, $this->createHttpClientOption())
->then(
function ($response) use ($returnType) {
$responseBody = $response->getBody();
if ($returnType === '\SplFileObject') {
$content = $responseBody; //stream goes to serializer
} else {
$content = (string) $responseBody;
}
return [
ObjectSerializer::deserialize($content, $returnType, []),
$response->getStatusCode(),
$response->getHeaders()
];
},
function ($exception) {
$response = $exception->getResponse();
$statusCode = $response->getStatusCode();
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$exception->getRequest()->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketAsync($cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateCloudBucketByCloudConnectorAsync($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putStreamFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n {\n $returnType = '';\n $request = $this->putStreamFileConfigRequest($server_name, $vhost_name, $streamfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'\n );\n }\n // verify the required parameter 'config_file' is set\n if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // form params\n if ($config_file !== null) {\n $multipart = true;\n $formParams['config_file'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function putSMILFileConfigAsyncWithHttpInfo($server_name, $vhost_name, $smilfile_name, $body)\n {\n $returnType = '';\n $request = $this->putSMILFileConfigRequest($server_name, $vhost_name, $smilfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderConfigRequest($server_name, $vhost_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $limit = null, $offset = null, $sort_by = null, $id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsByCloudConnectorRequest($cloud_connector_id, $limit, $offset, $sort_by, $id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderTemplateConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderTemplateConfigRequest($server_name, $vhost_name, $template_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function indexCloudBucketsAsyncWithHttpInfo($limit = null, $offset = null, $sort_by = null, $id = null, $cloud_connector_id = null, $pool_id = null, $name = null, $location = null, $price = null)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketCollection';\n $request = $this->indexCloudBucketsRequest($limit, $offset, $sort_by, $id, $cloud_connector_id, $pool_id, $name, $location, $price);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderStreamNameGroupConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $group_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderStreamNameGroupConfigRequest($server_name, $vhost_name, $template_name, $group_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putVHostConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n {\n $returnType = '';\n $request = $this->putVHostConfigRequest($server_name, $vhost_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putTranscoderOverlayDecodeConfigAsyncWithHttpInfo($server_name, $vhost_name, $template_name, $overlay_name, $body)\n {\n $returnType = '';\n $request = $this->putTranscoderOverlayDecodeConfigRequest($server_name, $vhost_name, $template_name, $overlay_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketAsyncWithHttpInfo($cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketRequest($cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putStreamFileConfigAdvAsyncWithHttpInfo($server_name, $vhost_name, $streamfile_name, $body)\n {\n $returnType = '';\n $request = $this->putStreamFileConfigAdvRequest($server_name, $vhost_name, $streamfile_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncResultCloudBucketsAsyncWithHttpInfo($cloud_connector_id, $job_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucketSimpleCollection';\n $request = $this->syncResultCloudBucketsRequest($cloud_connector_id, $job_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function syncCloudBucketsAsyncWithHttpInfo($cloud_connector_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\ActiveJobStatus';\n $request = $this->syncCloudBucketsRequest($cloud_connector_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateCloudBucketByPoolAsync($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n return $this->updateCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function updateRadiusConfigAsyncWithHttpInfo($body, $x_sds_auth_token = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\RadiusConfig';\n $request = $this->updateRadiusConfigRequest($body, $x_sds_auth_token);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateAisleCustomFieldsAsyncWithHttpInfo($body)\n {\n $returnType = '';\n $request = $this->updateAisleCustomFieldsRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putSSLConfigAsyncWithHttpInfo($server_name, $vhost_name, $portname, $body)\n {\n $returnType = '';\n $request = $this->putSSLConfigRequest($server_name, $vhost_name, $portname, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function contactsEmailPutAsyncWithHttpInfo($email, $body)\n {\n $returnType = '\\Swagger\\Client\\Model\\Contact';\n $request = $this->contactsEmailPutRequest($email, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateZoneSpaceAsyncWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data)\n {\n $returnType = '\\OpenAPI\\Client\\Model\\ZoneSpace';\n $request = $this->updateZoneSpaceRequest($cloud_pk, $id, $ifc_pk, $project_pk, $zone_pk, $data);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n if ($returnType === '\\SplFileObject') {\n $content = $response->getBody(); //stream goes to serializer\n } else {\n $content = (string) $response->getBody();\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $response->getBody()\n );\n }\n );\n }",
"public function putVHostTuneConfigAsyncWithHttpInfo($server_name, $vhost_name, $body)\n {\n $returnType = '';\n $request = $this->putVHostTuneConfigRequest($server_name, $vhost_name, $body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function mountStatusCloudBucketByCloudConnectorAsyncWithHttpInfo($cloud_connector_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\MountStatus';\n $request = $this->mountStatusCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function showCloudBucketByPoolAsyncWithHttpInfo($pool_id, $cloud_bucket_id)\n {\n $returnType = '\\NodeumSDK\\Client\\Model\\CloudBucket';\n $request = $this->showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | [
"0.68362594",
"0.6560665",
"0.6497853",
"0.6097409",
"0.5592598",
"0.5520596",
"0.5434978",
"0.5417808",
"0.5401213",
"0.5366305",
"0.52829593",
"0.5222308",
"0.5168185",
"0.5152465",
"0.5146143",
"0.5145582",
"0.51193124",
"0.51145",
"0.509375",
"0.50789917",
"0.5056756",
"0.5025887",
"0.5016087",
"0.4835962",
"0.48184198",
"0.48043346",
"0.47959325",
"0.4736252",
"0.47253397",
"0.47092754"
] | 0.73605466 | 0 |
Create request for operation 'updateConfigFileCloudBucket' | protected function updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file)
{
// verify the required parameter 'cloud_bucket_id' is set
if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $cloud_bucket_id when calling updateConfigFileCloudBucket'
);
}
// verify the required parameter 'config_file' is set
if ($config_file === null || (is_array($config_file) && count($config_file) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $config_file when calling updateConfigFileCloudBucket'
);
}
$resourcePath = '/cloud_buckets/{cloud_bucket_id}/config_file';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($cloud_bucket_id !== null) {
$resourcePath = str_replace(
'{' . 'cloud_bucket_id' . '}',
ObjectSerializer::toPathValue($cloud_bucket_id),
$resourcePath
);
}
// form params
if ($config_file !== null) {
$multipart = true;
$formParams['config_file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($config_file), 'rb');
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['multipart/form-data']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
if ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));
} else {
$httpBody = $_tempBody;
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
// this endpoint requires HTTP basic authentication
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
}
// this endpoint requires API key authentication
$apiKey = $this->config->getApiKeyWithPrefix('Authorization');
if ($apiKey !== null) {
$headers['Authorization'] = $apiKey;
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'PUT',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function updateCloudBucketRequest($cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucket'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function updateCloudBucketByPoolRequest($pool_id, $cloud_bucket_id, $cloud_bucket_body)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling updateCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_body' is set\n if ($cloud_bucket_body === null || (is_array($cloud_bucket_body) && count($cloud_bucket_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_body when calling updateCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($cloud_bucket_body)) {\n $_tempBody = $cloud_bucket_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function syncCloudBucketsRequest($cloud_connector_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n {\n $returnType = 'string';\n $request = $this->updateConfigFileCloudBucketRequest($cloud_bucket_id, $config_file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"function set_config($var, $val)\n{\n global $Cbucket;\n $Cbucket->configs[$var] = $val;\n return true;\n}",
"protected static function buckets( $r ) {\n\t\tswitch ( $r['method'] ) {\n\t\t\t//new bucket\n\t\t\tcase 'post':\n\t\t\t\t$aBucket = array();\n\t\t\t\tif ( !empty($r['data']['name']) ) { //name is required\n\t\t\t\t\t$aBucket['name'] = $r['data']['name'];\n\t\t\t\t\tif ( !empty($r['data']['desc']) ) { //desc is optional\n\t\t\t\t\t\t$aBucket['desc'] = $r['data']['desc'];\n\t\t\t\t\t}\n\t\t\t\t\tif ( !empty($r['data']['memberHandles']) && is_array($r['data']['memberHandles']) ) { //if has members\n\t\t\t\t\t\t$aBucket['memberHandles'] = self::verifyMembers( $r['data']['memberHandles'] );\n\t\t\t\t\t}\t\n\t\t\t\t\t$aBucket['bucketId'] = $bucketId = self::nextId('bucket');\n\t\t\t\t\t/**\n\t\t\t\t\t * @todo store json file somewhere\n\t\t\t\t\t*/\n\t\t\t\t\t$result = self::$es->add('bucket',$bucketId,json_encode( $aBucket ));\n\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//edit bucket\n\t\t\tcase 'put':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total !== 1 ) {\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bucket = (array)$bucket->hits->hits[0]->_source;\n\t\t\t\t\t\t$newBucket = $r['data'];\n\t\t\t\t\t\tif ( !empty($newBucket['name']) ) {\n\t\t\t\t\t\t\t$bucket['name'] = $newBucket['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['desc']) ) {\n\t\t\t\t\t\t\t$bucket['desc'] = $newBucket['desc'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !empty($newBucket['memberHandles']) && is_array($newBucket['memberHandles']) ) {\n\t\t\t\t\t\t\t$bucket['memberHandles'] = self::verifyMembers( $newBucket['memberHandles'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result = self::$es->add('bucket',$r['request'][1],json_encode($bucket));\n\t\t\t\t\t\tif ( $result !== NULL && $result->ok == true ) {\n\t\t\t\t\t\t\treturn $result->_id;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t//get bucket(s)\n\t\t\tcase 'get':\n\t\t\t\tif ( !empty($r['request'][1]) ) {\n\t\t\t\t\t$bucket = self::$es->query( 'bucket', array('q'=>'bucketId:'.$r['request'][1] ));\n\t\t\t\t\tif ( $bucket->hits->total === 1 ) {\n\t\t\t\t\t\treturn $bucket->hits->hits[0]->_source;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$_buckets = self::$es->query( 'bucket', array('q'=>'_type:bucket','size'=>BUCK_MAX_SIZE ));\n\t\t\t\t\tif ( $_buckets->hits->total > 0 ) {\n\t\t\t\t\t\t$buckets = array();\n\t\t\t\t\t\tforeach ( $_buckets->hits->hits as $bucket ) {\n\t\t\t\t\t\t\t$buckets[] = $bucket->_source;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $buckets;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t\t//delete bucket\n\t\t\tcase 'delete':\n\t\t\t\tif ( !empty($r['request'][1]) ) { \n\t\t\t\t\t$result = self::$es->delete('bucket',$r['request'][1]);\n\t\t\t\t\tif ( $result->ok == true ) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\t}\n\t}",
"protected function showCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function setProperties($props) {\n\t\t// Construct the URL, Headers, and Content...\n\t\t$url = Utils::buildRestPath ( $this->client, $this );\n\t\t$headers = array (\n\t\t\t\t'Content-Type: application/json' \n\t\t);\n\t\t$content = json_encode ( array (\n\t\t\t\t\"props\" => $props \n\t\t) );\n\t\t\n\t\t// Run the request...\n\t\t$response = Utils::httpRequest ( 'PUT', $url, $headers, $content );\n\t\t\n\t\t// Handle the response...\n\t\tif ($response == NULL) {\n\t\t\tthrow new Exception ( \"Error setting bucket properties.\" );\n\t\t}\n\t\t\n\t\t// Check the response value...\n\t\t$status = $response [0] ['http_code'];\n\t\tif ($status != 204) {\n\t\t\tthrow new Exception ( \"Error setting bucket properties.\" );\n\t\t}\n\t}",
"public function putBucket($bucketName);",
"protected function mountStatusCloudBucketRequest($cloud_bucket_id)\n {\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling mountStatusCloudBucket'\n );\n }\n\n $resourcePath = '/cloud_buckets/{cloud_bucket_id}/mount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByCloudConnectorRequest($cloud_connector_id, $cloud_bucket_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling showCloudBucketByCloudConnector'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByCloudConnector'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function updateConfigFileCloudBucketAsync($cloud_bucket_id, $config_file)\n {\n return $this->updateConfigFileCloudBucketAsyncWithHttpInfo($cloud_bucket_id, $config_file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putObject($bucketName, $input, $uri);",
"public function setBucket($bucket)\n {\n return $this->setOption('Bucket', $bucket);\n }",
"public function setBucket($var)\n {\n GPBUtil::checkString($var, True);\n $this->bucket = $var;\n\n return $this;\n }",
"public function setBucket($bucket, $data) {\n if (!in_array($bucket, array('global', 'local')))\n throw new \\InvalidArgumentException('Bucket type must be \"global\" or \"local\"');\n\n $this->buckets[$bucket] = $data;\n return true;\n }",
"public function createBucketAction()\n {\n $request = Request::createFromGlobals();\n $criteria = array_merge($request->request->all(), $request->query->all());\n\n $bucket = (isset($criteria['bucket']) && !empty($criteria['bucket'])) ? $criteria['bucket'] : '';\n\n $awsS3 = new AwsS3();\n // Bucket name should conform with DNS requirements i.e. no uppercase chars, no underscores, 3-63 chars, not end with a dash, no adjacent periods, no dashes next to periods\n $awsS3->setBucket($bucket);\n\n $result = $this->get(\"AwsS3Services\")->createBucket($awsS3);\n\n return new Response($result);\n }",
"protected function syncResultCloudBucketsRequest($cloud_connector_id, $job_id)\n {\n // verify the required parameter 'cloud_connector_id' is set\n if ($cloud_connector_id === null || (is_array($cloud_connector_id) && count($cloud_connector_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_connector_id when calling syncResultCloudBuckets'\n );\n }\n // verify the required parameter 'job_id' is set\n if ($job_id === null || (is_array($job_id) && count($job_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling syncResultCloudBuckets'\n );\n }\n\n $resourcePath = '/cloud_connectors/{cloud_connector_id}/cloud_buckets/-/sync';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if (is_array($job_id)) {\n $job_id = ObjectSerializer::serializeCollection($job_id, '', true);\n }\n if ($job_id !== null) {\n $queryParams['job_id'] = $job_id;\n }\n\n\n // path params\n if ($cloud_connector_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_connector_id' . '}',\n ObjectSerializer::toPathValue($cloud_connector_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'queued', 'working', 'failed', ]\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'queued', 'working', 'failed', ],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createFile($bucket,$filename,$data='') {\n\t\t$result = $this->client->putObject(array('Bucket'=>$bucket,'Key'=>$filename,'Body'=>$data));\n\t\treturn $result;\n\t}",
"public function setBucketProperties($name, array $props)\n {\n $properties = new RpbBucketProps();\n if (isset($props['allow_mult'])) {\n $properties->setAllowMult($props['allow_mult']);\n }\n if (isset($props['n_val'])) {\n $properties->setNVal($props['n_val']);\n }\n $req = new $this->_classMap[self::MSG_CODE_SET_BUCKET_REQ]();\n $req->setBucket($name);\n $req->setProps($properties);\t \n $this->_sendData($this->_encodeMessage($req, self::MSG_CODE_SET_BUCKET_REQ));\n list ($messageCode, $response) = $this->_receiveMessage();\n if ($messageCode == self::MSG_CODE_SET_BUCKET_RESP) {\n return true;\n } else {\n if ($messageCode == self::MSG_CODE_ERROR_RESP) {\n if ($response->hasErrmsg()) {\n throw new Riak_Transport_Exception(\"Protocol buffer error: \" . $response->getErrmsg());\n }\n }\n throw new Riak_Transport_Exception(\"Unexpected protocol buffer response code: \" . $messageCode);\n }\n }",
"function putObject($ossClient,$bucket){\n\t$object = \"b.file\";\n\t$options = array(\n\t\tOssClient::OSS_HEADERS => array(\n\t\t\t'x-oss-tagging' => 'key1=value1&key2=value2&key3=value3',\n\t\t));\n\ttry {\n\t\t// 通过简单上传的方式上传Object。\n\t\t$result = $ossClient->putObject($bucket, $object, __FILE__,$options);\n\t\tCommon::println(\"b.file is created\".PHP_EOL);\n\t\tCommon::println(\"tag is:\".$result['oss-requestheaders']['x-oss-tagging'].PHP_EOL);\n\t} catch (OssException $e) {\n\t\tprintf(__FUNCTION__ . \": FAILED\\n\");\n\t\tprintf($e->getMessage() . \"\\n\");\n\t\treturn;\n\t}\n\t\n\tprint(__FUNCTION__ . \": OK\" . \"\\n\");\n}",
"static function changeBucket ($oldBucketId, $newBucketName, $clientId, $template, $database)\n\t{\n\n\t\tif ( empty($newBucketName) )\n\t\t{\n\t\t\treturn;\t\n\t\t}\n\t\t// See if there is a bucket with that name already\n\t\t$bucketId = 0;\n\t\t$bucketIdRes = self::searchClientBucketsByBucketName($newBucketName, $clientId, $database);\n\t\t$bucketIdRow = $database->fetchRow($bucketIdRes);\t\n\t\t$bucketId = $bucketIdRow['BUCKET_ID'];\n\t\t\n\t\t// If the bucket already exists AND\n\t\t// we are not changing from a default bucket name\n\t\t// then errors\n\t\tif( $bucketId > 0 && $oldBucketId != 1 && strtolower($newBucketName) != strtolower('Untagged'))\n\t\t{\n\t\t\t// A bucket already exists with that name\n\t\t\t$template->parse(\"MESSAGE\",\"Oops, you already have a bucket with that name\");\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Changing from a default bucket\n\t\tif( $oldBucketId == 1)\n\t\t{\n\t\t\t// If a bucket does not exists with that name\n\t\t\t// we need to create a new Bucket\n\t\t\tif( $bucketId <= 0)\n\t\t\t{\n\t\t\t\t// Create a new bucket\n\t\t\t\t$sql = \"INSERT INTO\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\t\t(CLIENT_ID, BUCKET_NAME)\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('$clientId','$newBucketName')\"; \n\t\t\t\t$res = $database->query($sql);\n\t\t\t\t$bucketId = $database->getLastId();\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// Changing from a NON default bucket\n\t\telse\n\t\t{\t\t\t\n\t\t\t// If user is trying to change the name to\n\t\t\t// untagged (default) again then we will\n\t\t\t// keep the bucket name around but will move the\n\t\t\t// services to the untagged (default) bucket\n\t\t\t// Otherwise we update de bucket name here\n\t\t\tif ( strtolower($newBucketName) == strtolower('Untagged') )\n\t\t\t{\n\t\t\t\t$bucketId = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We just change the name of the bucket\n\t\t\t\t$sql = \"UPDATE\n\t\t\t\t\t\t\tBUCKET\n\t\t\t\t\t\tSET \n\t\t\t\t\t\t\tBUCKET_NAME = '$newBucketName'\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\t\t$bucketId = $oldBucketId;\n\t\t\t\t\n\t\t\t\t$res = $database->query($sql);\t\n\n\t\t\t}\t\t\t\n\t\n\t\t}\n\n\t\t// Move all the services to the \n\t\t// new assigned bucket which could be\n\t\t// an exising bucket or a new one\n\t\t$sql = \"UPDATE\n\t\t\t\t\tCLIENT_SERVICE_BUCKET\n\t\t\t\tSET \n\t\t\t\t\tBUCKET_ID = $bucketId\n\t\t\t\tWHERE\n\t\t\t\t\tCLIENT_ID = $clientId\n\t\t\t\tAND\n\t\t\t\t\tBUCKET_ID = $oldBucketId\";\n\t\t\n\t\t$res = $database->query($sql);\n\t\t\n\t\t$template->parse(\"MESSAGE\",\"\");\n\t\t\n\t}",
"function wasabi_s3_client_args( $args ) {\n\t\t$args['endpoint'] = 'https://s3.eu-central-1.wasabisys.com';\n\t\t$args['region'] = 'eu-central-1';\n\t\t$args['use_path_style_endpoint'] = true;\n\n\t\treturn $args;\n\t}",
"protected function putStreamFileConfigRequest($server_name, $vhost_name, $streamfile_name, $body)\n {\n // verify the required parameter 'server_name' is set\n if ($server_name === null || (is_array($server_name) && count($server_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $server_name when calling putStreamFileConfig'\n );\n }\n // verify the required parameter 'vhost_name' is set\n if ($vhost_name === null || (is_array($vhost_name) && count($vhost_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $vhost_name when calling putStreamFileConfig'\n );\n }\n // verify the required parameter 'streamfile_name' is set\n if ($streamfile_name === null || (is_array($streamfile_name) && count($streamfile_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $streamfile_name when calling putStreamFileConfig'\n );\n }\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling putStreamFileConfig'\n );\n }\n\n $resourcePath = '/v2/servers/{serverName}/vhosts/{vhostName}/streamfiles/{streamfileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($server_name !== null) {\n $resourcePath = str_replace(\n '{' . 'serverName' . '}',\n ObjectSerializer::toPathValue($server_name),\n $resourcePath\n );\n }\n // path params\n if ($vhost_name !== null) {\n $resourcePath = str_replace(\n '{' . 'vhostName' . '}',\n ObjectSerializer::toPathValue($vhost_name),\n $resourcePath\n );\n }\n // path params\n if ($streamfile_name !== null) {\n $resourcePath = str_replace(\n '{' . 'streamfileName' . '}',\n ObjectSerializer::toPathValue($streamfile_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'text/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'text/xml', 'application/json'],\n ['application/xml', 'text/xml', 'application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function showCloudBucketByPoolRequest($pool_id, $cloud_bucket_id)\n {\n // verify the required parameter 'pool_id' is set\n if ($pool_id === null || (is_array($pool_id) && count($pool_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $pool_id when calling showCloudBucketByPool'\n );\n }\n // verify the required parameter 'cloud_bucket_id' is set\n if ($cloud_bucket_id === null || (is_array($cloud_bucket_id) && count($cloud_bucket_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $cloud_bucket_id when calling showCloudBucketByPool'\n );\n }\n\n $resourcePath = '/pools/{pool_id}/cloud_buckets/{cloud_bucket_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($pool_id !== null) {\n $resourcePath = str_replace(\n '{' . 'pool_id' . '}',\n ObjectSerializer::toPathValue($pool_id),\n $resourcePath\n );\n }\n // path params\n if ($cloud_bucket_id !== null) {\n $resourcePath = str_replace(\n '{' . 'cloud_bucket_id' . '}',\n ObjectSerializer::toPathValue($cloud_bucket_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testCreateBucket()\n {\n $client= new S3Client(\n [\n 'credentials' => [\n 'key' => 'AKIAIOSFODNN7EXAMPLE',\n 'secret' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'\n ],\n 'region' => $this->bucket_region,\n 'version' => 'latest',\n\n 'endpoint' => $this->end_point,\n 'scheme' => 'http',\n //'bucket_endpoint' => true, //<= This may not be required. Because this is used for CNAME type bucket.\n ]\n );\n //end create S3 client\n\n //start create bucket\n $client->createBucket(\n [\n 'ACL' => 'private',\n 'Bucket' => $this->bucket_name,\n 'CreateBucketConfiguration' => [\n 'LocationConstraint' => $this->bucket_region,\n ],\n ]\n );\n //end create bucket\n\n return $client;\n }",
"public function putAction()\n {\n $body = $this->getRequest()->getRawBody();\n $data = Zend_Json::decode($body);\n\n if (\n !is_array($data) ||\n !array_key_exists('fieldMapping', $data) ||\n !is_array($data['fieldMapping']) ||\n !array_key_exists('id', $data['fieldMapping'])\n ) {\n $this->_helper->json(array(\n 'success' => false,\n 'message' => 'invalid_request',\n ));\n }\n $id = $data['fieldMapping']['id'];\n unset($data['fieldMapping']['id']);\n\n $this->filesConfigModelMapper->update($id, $data['fieldMapping']);\n\n $fileConfig = $this->filesConfigModelMapper->getById($id);\n\n $this->_helper->json(array(\n 'success' => true,\n 'message' => 'field_mapping_saved',\n 'fieldMapping' => $fileConfig->toArray()\n ));\n }",
"function multiuploadFile($ossClient,$bucket){\n\t$object = \"b.file\";\n\t$file = __FILE__;\n\t$options = array(\n\t\tOssClient::OSS_CHECK_MD5 => true,\n\t\tOssClient::OSS_PART_SIZE => 1,\n\t\tOssClient::OSS_HEADERS => array(\n\t\t\t'x-oss-tagging' => 'key1=value1&key2=value2&key3=value3',\n\t\t),\n\t);\n\t\n\ttry {\n\t\t$result = $ossClient->multiuploadFile($bucket, $object, $file, $options);\n\t\tCommon::println(\"b.file is created\".PHP_EOL);\n\t\tCommon::println(\"tag is:\".$result['oss-requestheaders']['x-oss-tagging'].PHP_EOL);\n\t} catch (OssException $e) {\n\t\tprintf(__FUNCTION__ . \": FAILED\\n\");\n\t\tprintf($e->getMessage() . \"\\n\");\n\t\treturn;\n\t}\n\t\n\tprint(__FUNCTION__ . \": OK\" . \"\\n\");\n}",
"protected function s3BucketRequestConfig(string $siteName): array\n {\n $s3ConfigArray = ['Bucket' => $this->s3BucketForSite($siteName)];\n try {\n $s3KeyPrefix = $this->getSiteConfigItem('database_s3_key_prefix_string', $siteName);\n $this->say(\"'$siteName' S3 Key prefix: '$s3KeyPrefix'\");\n $s3ConfigArray['Prefix'] = $s3KeyPrefix;\n } catch (TaskException) {\n $this->say(\"No S3 Key prefix found for $siteName.\");\n }\n return $s3ConfigArray;\n }"
] | [
"0.5966773",
"0.5705068",
"0.5478837",
"0.51944923",
"0.5172419",
"0.5070578",
"0.48354232",
"0.48291573",
"0.47979167",
"0.4761426",
"0.468874",
"0.46564052",
"0.4620421",
"0.4581698",
"0.4576293",
"0.45514038",
"0.45497572",
"0.45319474",
"0.4515572",
"0.44886148",
"0.44621933",
"0.44288918",
"0.44176483",
"0.4404819",
"0.4374421",
"0.4367418",
"0.43575016",
"0.4327807",
"0.43262252",
"0.43258423"
] | 0.7479884 | 0 |
Return query to use based on given modulename, fieldname Useful to handle specific case handling for Popup | function getQueryByModuleField($module, $fieldname, $srcrecord, $query='') {
// $srcrecord could be empty
global $adb,$log;
$query_relation = ' INNER JOIN vtiger_crmentityrel ON (vtiger_crmentityrel.relcrmid = vtiger_crmentity.crmid OR vtiger_crmentityrel.crmid = vtiger_crmentity.crmid) ';
$wherepos = stripos($query, 'where'); // there is always a where
$query_body = substr($query, 0, $wherepos-1);
$query_cond = substr($query, $wherepos+5);
if($module == 'Invoice' || $module == 'Contacts' || $module == 'Quotes' || $module == 'SalesOrder') {
$accountID = vtlib_purify($_REQUEST['acc_id']);
$contactID = vtlib_purify($_REQUEST['cont_id']);
/*$query = "SELECT vtiger_crmentity.*, vtiger_cbaddress.*, vtiger_cbaddresscf.*
FROM vtiger_cbaddress
INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_cbaddress.cbaddressid
INNER JOIN vtiger_cbaddresscf ON vtiger_cbaddresscf.cbaddressid = vtiger_cbaddress.cbaddressid
LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid
LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid
WHERE vtiger_cbaddress.cbaddressid > 0 AND vtiger_crmentity.deleted = 0" ORDER BY cbaddressno ASC ;*/
if(isset($_REQUEST['cont_id']) && $_REQUEST['cont_id'] !='' && $_REQUEST['acc_id'] =='') {
$query1 = $query_body . $query_relation . " WHERE (vtiger_crmentityrel.crmid = $contactID OR vtiger_crmentityrel.relcrmid = $contactID) and " . $query_cond;
return $query1;
}
elseif((isset($_REQUEST['acc_id']) && $_REQUEST['acc_id'] !='' && $_REQUEST['cont_id'] =='' )) {
$query1 = $query_body . $query_relation . " WHERE (vtiger_crmentityrel.crmid = $accountID OR vtiger_crmentityrel.relcrmid = $accountID) and " . $query_cond;
return $query1;
}
elseif(isset($_REQUEST['acc_id']) && $_REQUEST['acc_id'] !='' && isset($_REQUEST['cont_id']) && $_REQUEST['cont_id'] !=''){
$query1 = $query_body . $query_relation . " WHERE (vtiger_crmentityrel.crmid = $accountID OR vtiger_crmentityrel.relcrmid = $accountID or vtiger_crmentityrel.crmid = $contactID OR vtiger_crmentityrel.relcrmid = $contactID) and " . $query_cond;
$res = $adb->query($query1);
$number= $adb->num_rows($res);
if($number > 0){
return $query1;
}
else return $query;
}
else return $query;
}
elseif($module == 'Accounts'){
$accountID = vtlib_purify($_REQUEST['acc_id']);
if((isset($_REQUEST['acc_id']) && $_REQUEST['acc_id'] !='')){
$query1 = $query_body . $query_relation . " WHERE (vtiger_crmentityrel.crmid = $accountID OR vtiger_crmentityrel.relcrmid = $accountID) and " . $query_cond;;
return $query1;
}
else return $query;
}
elseif($module == 'PurchaseOrder'){
$contactID = vtlib_purify($_REQUEST['cont_id']);
if((isset($_REQUEST['cont_id']) && $_REQUEST['cont_id'] !='')){
$query1 = $query_body . $query_relation . " WHERE (vtiger_crmentityrel.crmid = $contactID OR vtiger_crmentityrel.relcrmid = $contactID) and " . $query_cond;;
return $query1;
}
else return $query;
}
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFieldQuery() {\n\t\tif ($this->_fieldName) {\n\t\t\t$field = $this->_fieldName;\n\t\t\tif ($isTranslated = $field[0] == '*')\n\t\t\t\t$field = substr($field, 1);\n\t\t\t$p0 = strpos($field, '!');\n\t\t\tif ($p0 !== false) {\n\t\t\t\t$expression = $field;\n\t\t\t\t// Extract the field name\n\t\t\t\t$pre = substr($field, 0, $p0);\n\t\t\t\t$field = substr($field, $p0+1);\n\t\t\t\t$p1 = strpos($field, '!')-1;\n\t\t\t\tif ($p1 !== false) {\n\t\t\t\t\t$post = substr($field, $p1+2);\n\t\t\t\t\t$field = substr($field, 0, $p1+1);\n\t\t\t\t}\n\t\t\t} \n\t\t\treturn $pre . ($isTranslated ? 'translation' : 'item') . '.`' .\n\t\t\t\t$field . '`' . $post;\n\t\t} else\n\t\t\treturn null; \n\t}",
"function bbp_get_query_name()\n{\n}",
"public function getQueryByModuleField($sourceModule, $field, $record, \\App\\QueryGenerator $queryGenerator)\n\t{\n\t\t$queryGenerator->addNativeCondition(['and',\n\t\t\t['not in', 'vtiger_notes.notesid', (new App\\Db\\Query())->select(['notesid'])->from('vtiger_senotesrel')->where(['crmid' => $record])],\n\t\t\t['vtiger_notes.filestatus' => 1]\n\t\t]);\n\t}",
"public static function getEntityName($fieldname, $module = '') {\n\t\t$db = PearDatabase::getInstance();\n\t\t$result = $db->pquery('SELECT `modulename` FROM `vtiger_entityname` WHERE `entityidcolumn` = ? LIMIT 1', array($fieldname));\n\t\treturn $db->query_result($result, 0, 'modulename');\n\t}",
"public function get_field($query,$field)\n{\n $data = $this->query_single_data($query);\n return $data[$field];\n}",
"public function get_field_name($field_name);",
"public function getSearchModuleName();",
"public function getFeedQuery($field)\n{\n if (isset($field[DB_TYPE])) {\n return $field[DB_TYPE];\n } else {\n return $field['query'];\n }\n}",
"public function select($field_name);",
"public function getPopupFields() {\n\t\t$entityInstance = CRMEntity::getInstance($this->getName());\n\t\treturn $entityInstance->search_fields_name;\n\t}",
"function get_info_by_name( $module_name)\n\t{\n\t\t$query = $this->db->get_where( $this->table_name, array( 'role_name' => $role_name ));\n\t\t\n\t\tif ( $query->num_rows() == 1 ) {\n\t\t\treturn $query->row();\n\t\t} else {\n\t\t\treturn $this->get_empty_object( $this->table_name );\n\t\t}\n\t}",
"function load_query()\n {\n global $DB, $USER;\n $query = 'SELECT mdl_role.name\n FROM mdl_role\n inner join mdl_role_assignments on mdl_role_assignments.roleid=mdl_role.id\n where mdl_role_assignments.userid='.$USER->id;\n\n return $DB->get_fieldset_sql($query, array('name'));\n }",
"protected function getQueryname(){\n if(get_parent_class($this)!='BaseDAO'){\n $classname = get_parent_class($this);\n }else{\n $classname = get_class($this);\n }\n $classname = substr($classname,0,strlen($classname)-3);\n return $classname . 'Query';\n }",
"function dbGetFieldId($name) {\n\tglobal $dbo;\n\t$sql = 'SELECT field_id FROM '.$dbo->table['subscriber_fields'].' WHERE field_name=\\''.$name.'\\'';\n\treturn ($dbo->query($sql, 0));\n}",
"public function whereMod($fieldName, $mod)\n {\n return $this->addWhere($fieldName, array('$mod' => $mod));\n }",
"public function getField($field);",
"function getField($field, $table, $wh, $cond) {\n $this->db->select($field, FALSE);\n if ($wh && $cond)\n $this->db->where($wh, $cond);\n\n $res = $this->db->get($table);\n\n //if we want some aggreagration then we pass field name in $wh\n $result = $res->row_array();\n\n //echo 'ddsfdfd'.$result[$field];die;\n return $result[$field];\n }",
"function pdo_get_field_value($qry, $fieldname, $default)\n{\n $row = pdo_single_row_query($qry);\n\n if (!empty($row))\n {\n $f = $row[\"$fieldname\"];\n }\n else\n {\n $f = $default;\n }\n\n return $f;\n}",
"public function field($name);",
"function field_name( $field, $query = FALSE )\n\t{\n\t\t$result = FALSE;\n\n\t\tif ( !$query )\n\t\t\t$query = $this->last_query;\n\n\t\tif ( $query && $this->connected ) {\n\t\t\t$result = @mysqli_fetch_field_direct($query, $field);\n\t\t\t$result = $result->name;\n\t\t}\n\n\t\treturn $result;\n\n\t}",
"function etheme_get_query_custom_field($field){\n $page = get_query_var('et_page-id');\n $page_id = ( isset( $page['id'] ) ) ? $page['id'] : false;\n\n if ( $page_id ) {\n $field = etheme_get_custom_field($field, $page_id);\n }else{\n $field = false;\n }\n\n return $field;\n}",
"function constructCustomQueryAddendum($tablename,$module)\n {\n\t\t $tabid=getTabid($module);\t\t\n $sql1 = \"select columnname,fieldlabel from ec_field where generatedtype=2 and tabid=\".$tabid;\n $result = $this->db->query($sql1);\n $numRows = $this->db->num_rows($result);\n $sql3 = \"select \";\n for($i=0; $i < $numRows;$i++)\n {\n $columnName = $this->db->query_result($result,$i,\"columnname\");\n $fieldlable = $this->db->query_result($result,$i,\"fieldlabel\");\n //construct query as below\n if($i == 0)\n {\n $sql3 .= $tablename.\".\".$columnName. \" '\" .$fieldlable.\"'\";\n }\n else\n {\n $sql3 .= \", \".$tablename.\".\".$columnName. \" '\" .$fieldlable.\"'\";\n }\n\n }\n if($numRows>0)\n {\n $sql3=$sql3.',';\n }\n return $sql3;\n\n }",
"public function loadFieldByName($fieldname){\n\t\treturn CrugeFactory::get()->getICrugeFieldLoadModelByName($fieldname);\n\t}",
"public function getField($name);",
"function ModuleSearchField($data,$rdata=\"\",$rval=\"\")\n {\n return $this->CreateCascatingSearchField($data,$data,$rval);\n }",
"function _field_name($field){\n if(count($this->_path)){\n return $this->_path[count($this->_path) - 1] . '->' . $field;\n }else{\n return '$publication->' . $field;\n }\n }",
"function get($field_name,$type){\n// dbg_tr();\n return data_model::get(get_class($this),$field_name,$type);\n }",
"abstract protected function get_module_form();",
"public abstract function field($sql);",
"function getFieldDetail($TableName,$Field,$Condition='')\n{\n\tglobal $con ;\n\t//echo \"SELECT \".$Field.\" FROM \".$TableName.$Condition;\n\t\n\t$res = mysqli_query($con,\"SELECT \".$Field.\" FROM \".$TableName.$Condition);\n\t$resdata = mysqli_fetch_array($res);\n\t//return $resdata[$Field];\n\t$ans = isset($resdata[0]) ? $resdata[0] : '';\n\t//mysqli_close($con);\n\treturn $ans;\n}"
] | [
"0.62916964",
"0.58705026",
"0.5843684",
"0.5829445",
"0.5778483",
"0.57279176",
"0.5647853",
"0.56396145",
"0.5638036",
"0.56247705",
"0.5572027",
"0.556076",
"0.5484328",
"0.54247475",
"0.5417132",
"0.5400849",
"0.5394318",
"0.53186816",
"0.53117937",
"0.5306348",
"0.5293183",
"0.5293035",
"0.5288076",
"0.5274762",
"0.5261086",
"0.5252995",
"0.5224489",
"0.52132785",
"0.521302",
"0.520775"
] | 0.6571324 | 0 |
getter and setter for state_id | function get_state_id(){
return $this->state_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getstateId()\n {\n return $this->stateId;\n }",
"public function getStateId()\n {\n return $this->stateId;\n }",
"public function getIdState()\n {\n return $this->idState;\n }",
"public function setIdState($idState)\n {\n $this->idState = $idState;\n }",
"public function entityStateId()\r\n {\r\n return $this->getState()->id;\r\n }",
"public function state_id($id)\n {\n return $this->state(function (array $attributes) use ($id) {\n return [\n 'state_id' => $id,\n ];\n });\n }",
"public function getState($stateId) {\n }",
"public function setState($state)\n {\n return $this->setVariable(\"state.id|$state\");\n }",
"public function getId_sale_state()\n {\n return $this->id_sale_state;\n }",
"public function __toString()\n {\n return $this->stateId;\n }",
"public function getId()\n\t{\n\t\treturn $this->getState('__id');\n\t}",
"public function entityStateId()\n {\n if ($this->getEventVenue() === null || $this->getEventVenue()->getType() != \"simple\") return \"\";\n return $this->getEventVenue()->getCity()->getState()->id;\n }",
"public function setStateID($stateID = 52)\n {\n $this->stateID = $stateID;\n\n return $this;\n }",
"protected function getStateSessionIdentifier()\n\t{\n\t\treturn $this->getPresenter()->getAction(true) . $this->getUniqueId();\n\t}",
"public function findstate($id)\n\t{\n\t\t // should not be searched.\n\t\t $name = State::model()->findByPk($id);\n\t\t return $name->state_name;\n\t\t \n\t}",
"function assignState(eZContentObjectState $state)\n {\n $groupID = $state->attribute('group_id');\n $stateID = $state->attribute('id');\n $contentObjectID = $this->ID;\n\n $db = eZDB::instance();\n $db->begin();\n\n $currentStateIDArray = $this->stateIDArray(true);\n $currentStateID = $currentStateIDArray[$groupID];\n\n if ($currentStateID == $stateID) {\n $db->rollback();\n\n return false;\n }\n\n $sql = \"UPDATE ezcobj_state_link\n SET contentobject_state_id=$stateID\n WHERE contentobject_state_id=$currentStateID AND\n contentobject_id=$contentObjectID\";\n $db->query($sql);\n\n $db->commit();\n\n $this->StateIDArray[$groupID] = $stateID;\n\n return true;\n }",
"public function setState($state) {\n if ($state instanceof PaperStateApi) {\n $state = $state->getId();\n }\n\n $this->paperState = NULL;\n $this->state_id = $state;\n $this->toSave['state.id'] = $state;\n }",
"function getStateid($state_abbr=\"\")\n\t{\t\n\t\tglobal $db;\n\t\tif($cId==\"\")\n\t\t$cId\t= '223';\n\n\t\t$sql_state\t= \"select * from ad_state WHERE `short_name` = '{$state_abbr}' order by state_name asc\";\n\t\t$res_state\t= $db->select_data($sql_state);\n\n\n\t\tif(count($res_state) > 0)\n\t\t{\n\t\t\t$stateOption = $res_state[0]['state_id'];\n\t\t\t\n\t\t\treturn $stateOption;\n\t\t}\n\n\t}",
"public function setStateId($stateId)\n {\n $this->stateId = $stateId;\n\n return $this;\n }",
"public function setstateId($stateId)\n {\n $this->stateId = $stateId;\n\n return $this;\n }",
"public function getState(): int {\n return $this->state;\n }",
"function get_state()\n {\n return $this->state;\n }",
"public function set_state(int $newval): int\n {\n $rest_val = strval($newval);\n return $this->_setAttr(\"state\", $rest_val);\n }",
"public function state()\n\t{\n\t\treturn $this->belongsTo('Politik\\Entities\\State');\n\t}",
"public function state(): int;",
"public function getState();",
"public function getState();",
"public function getState();",
"public function getState();",
"public function getStateKey(): string;"
] | [
"0.79501796",
"0.7869926",
"0.74588627",
"0.7274622",
"0.7242118",
"0.6907113",
"0.67906106",
"0.6770025",
"0.6702431",
"0.6655388",
"0.650748",
"0.64912933",
"0.64098245",
"0.6271221",
"0.61131734",
"0.6099452",
"0.6068369",
"0.604425",
"0.60370576",
"0.6029502",
"0.5999353",
"0.596255",
"0.59005356",
"0.5883994",
"0.58617246",
"0.5806255",
"0.5806255",
"0.5806255",
"0.5806255",
"0.5790836"
] | 0.8143416 | 0 |
getter and setter for deleted | function get_deleted(){
return $this->deleted;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setToBeDeleted();",
"public function setDeleted() {\n $this->status = self::STATUS_DELETED;\n return $this->save(false, array('status'));\n }",
"public function getDeleted()\n {\n return $this->deleted;\n }",
"public function getDeleted()\n {\n return $this->deleted;\n }",
"public function withoutDeleted(): self\n {\n }",
"public function setDeleted($deleted) \n {\n \t$this->deleted = $deleted;\n }",
"public static function withDeleted(): self\n {\n }",
"public function getDeleted() {\n\t\treturn $this->deleted;\n\t}",
"public function deleted($deleted=true) {\n\t\t$this->_deleted = $deleted;\n\t}",
"public function withDeleted(): self\n {\n }",
"public function isDeleted();",
"public function setDelete($val)\n {\n $this->_propDict[\"delete\"] = $val;\n return $this;\n }",
"public function onlyDeleted(): self\n {\n }",
"public static function onlyDeleted(): self\n {\n }",
"public static function withoutDeleted(): self\n {\n }",
"public function delete()\n {\n $this->deleted = true;\n }",
"function getPropertiesDelete() {\n\treturn $this->_propertiesDelete;\n\t}",
"public function getDeleted()\n {\n return $this->object()->getDeleted();\n }",
"public function markDelete();",
"public function delete()\n {\n \t$this->setDeleted(true);\n }",
"public function deleted(): ?bool\n {\n\n }",
"public function isDeleted() { return (bool)$this->is_deleted; }",
"public function markEntityAsDeleted();",
"public function markAsDeleted() {\n\t\t$this->isDeleted = true;\n\t}",
"public function getDelete(): bool\n {\n return $this->delete;\n }",
"public function getDel($key) {}",
"protected function lightDelete()\n {\n $now = Time::current();\n $key = $this->getPKvalue();\n //\n $sql = 'update '.$this->DBtable.\" set deleted_at='\".$now.\"' where \".$this->keyName.\" = '\".$key.\"' \";\n if (Database::exec($sql)) {\n $this->clean();\n $this->deleted_at = $now;\n }\n }",
"public function delete()\n {\n self::remove($this->key);\n $this->key = null;\n $this->value = null;\n }",
"public function setDeleted($deleted) {\n $this->definition['deleted'] = $deleted;\n return $this;\n }",
"abstract public static function deleted($callback);"
] | [
"0.7692057",
"0.7223003",
"0.7054388",
"0.7054388",
"0.70396316",
"0.69821113",
"0.6953224",
"0.6939761",
"0.693182",
"0.6904779",
"0.6884649",
"0.68393457",
"0.6833108",
"0.6813463",
"0.6787158",
"0.66730225",
"0.6576397",
"0.6558895",
"0.65542835",
"0.6549765",
"0.6473851",
"0.6473163",
"0.64512974",
"0.6438783",
"0.64093137",
"0.6408058",
"0.6390667",
"0.6386042",
"0.6385573",
"0.63836896"
] | 0.7627876 | 1 |
Push value whether it's an array or string | int | private function add_value(mixed $value){
array_push($this->values, ...(is_array($value) ? $value : [$value]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function push($value);",
"public function push($value);",
"function add(array $data) : ?array;",
"public function push($value)\n {\n $args = func_get_args();\n foreach ($args as $a) {\n array_push($this->_arr, $a);\n }\n }",
"function mycustomtype($array){\n$array[]='products';\nreturn $array;\n}",
"function push($value1) {\n $args = func_get_args();\n for ($i = 0; $i < count($args); $i++) {\n array_push($this->a, $args[$i]);\n };\n return count($this->a);\n }",
"abstract public function push();",
"public function push($value){\r\n array_unshift($this->data,$value);\r\n }",
"public function add($value) {\n if (!is_string($value) && !is_int($value) && !is_array($value)) {\n $this->errorno = self::ERR_INPUT_PARAM;\n $this->error = self::MSG_TYPE_NOT_SUPPORTED;\n return $this->errorno;\n }\n $status = $this->db->apply($this->key, 'lset', 'add', array($this->bin, $value));\n $this->processStatusCode($status);\n return $this->errorno;\n }",
"public function add($value) {\n if (!is_string($value) && !is_int($value) && !is_array($value)) {\n $this->errorno = self::ERR_INPUT_PARAM;\n $this->error = self::MSG_TYPE_NOT_SUPPORTED;\n return $this->errorno;\n }\n $status = $this->db->apply($this->key, 'llist', 'add', array($this->bin, $value));\n $this->processStatusCode($status);\n return $this->errorno;\n }",
"function add_value(array $value)\n {\n array_push($this->values_to_add, $value);\n }",
"function array_push (array &$array, $var, $_ = null) {}",
"public function push($data);",
"public function push($key, $value);",
"static public function arrayPush (array &$array)\n {\n $args = func_get_args();\n $argc = func_num_args();\n if ($argc < 2) {\n trigger_error(sprintf('%s: expects at least 2 parameters, %s given', __FUNCTION__, $argc), E_USER_WARNING);\n return false;\n }\n\n array_shift($args);\n foreach ($args as $key => $item) {\n if (is_array($item)) {\n if (count($item) > 0) {\n foreach ($item as $subKey => $subItem) {\n $array[$subKey] = $subItem;\n }\n }\n }\n else {\n $array[$key] = $item;\n }\n }\n\n return count($array);\n }",
"public function push($value): void;",
"private function pushTo($sarrayAttr, $value)\n {\n if (!is_string($value)) throw new \\Exception('Value should be a string');\n $this->{$sarrayAttr}[] = $value;\n }",
"static public function push($key,$value);",
"function array_push_object($array, $value) {\n $array[] = $value;\n return $array;\n }",
"public function push( $value ) {\n\t\t$this->stack[ $this->count ] = $value;\n\t\t$this->count++;\n\t}",
"public function rightPush($key, $value)\n {\n $value = json_encode($value);\n return parent::rPush($key, $value);\n }",
"public function appendValue($data, $type, $element)\n {\n foreach ($data as $key => & $item) {\n $item[$element] = $type;\n }\n return $data; \n }",
"private function appendValue($data, $type, $element)\n\t{\n\t foreach ($data as $key => & $item) {\n\t $item[$element] = $type;\n\t }\n\t return $data; \n\t}",
"public function pushValue($value)\n {\n $value = $this->_preprocessValue($value);\n $this->value[] = $value;\n $this->callTrigger();\n }",
"public function add(array $input);",
"public function add($array);",
"public function push($value)\n {\n array_push($this->stack, $value);\n }",
"public function addValue($value)\n\t{\n\t\t// Check if this Parameter has a previously set value\n\t\tif($this->value === null)\n\t\t{\n\t\t\t// Initialize this Parameters value to a new array\n\t\t\t$this->value = array();\n\t\t}\n\t\t\n\t\t// Check if the new value is an array\n\t\tif(!is_array($value))\n\t\t{\n\t\t\t// Append new single value to this Parameters value array\n\t\t\t$this->value[] = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Append every new value to this Parameters value array\n\t\t\tforeach($value as $v) $this->value[] = $v;\n\t\t}\n\t}",
"public function push(string $key, mixed $value): void;",
"public function addValue($value)\n {\n if ($this->type->basicValueCheck($value)) {\n $array = $this->getRawValue();\n $array[] = $this->type->castValue($value);\n $this->setRawValue($array);\n\n return true;\n }\n\n return false;\n }"
] | [
"0.6565333",
"0.6565333",
"0.6324615",
"0.63101465",
"0.6122472",
"0.60186434",
"0.5955586",
"0.59312093",
"0.57764184",
"0.5711251",
"0.56615865",
"0.5639075",
"0.56367826",
"0.56363773",
"0.56244266",
"0.5621526",
"0.5617878",
"0.5608335",
"0.55690295",
"0.555817",
"0.5547472",
"0.55221754",
"0.552151",
"0.5512297",
"0.5506942",
"0.5478232",
"0.54479337",
"0.5428909",
"0.54284865",
"0.5426237"
] | 0.69041765 | 0 |
Retrieve a required template variable. Will trigger a fatal error if the variable hasn't been set. | public function getRequired ($name)
{
if (! array_key_exists($name, $this->vars)) {
$errorMessage = __CLASS__.'::'.__FUNCTION__.
"(): missing the required variable '{$name}' in template {$this->tplfile}";
trigger_error($errorMessage, E_USER_ERROR);
return null;
}
return $this->vars[$name];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_the_variable($var) {\n\n\t// Get variables\n\t$options = get_option('jmr_var');\n\n\tif ( ( !$var ) || ( !isset( $options[$var] ) ) ) {\n\t\treturn false;\n\t}\n\n\t$variable = $options[$var];\n\treturn $variable;\n\n}",
"function __get($varname){\n return isset($this->templateVars[$varname]) ? $this->templateVars[$varname] : '';\n }",
"function lingotek_variable_get($var, $drupal, $default) {\n if ($var === FALSE) {\n return variable_get($drupal, $default);\n }\n else {\n return $var;\n }\n}",
"protected function expectRequiredVariable(string $var): string\n {\n $exception = \\Vaites\\Laravel\\BladeExpects\\Exceptions\\UndefinedVariableException::class;\n $message = \"View expects $var variable to be defined\";\n\n return \"if(!isset($var)){ throw new $exception('$message'); }\\n\";\n }",
"public function & __get($key) {\n if (isset($this->_data[$key]))\n return $this->_data[$key];\n\n if (isset(self::$_global_data[$key]))\n return self::$_global_data[$key];\n \n throw new ViewException(\"Template variable is not set: '$key'\");\n }",
"public function __get($name){\n if(array_key_exists($name, $this->templateVars)){\n return $this->templateVars[$name];\n } else {\n return '';\n }\n }",
"function get_var($var_key, $default_value = null) {\n\tglobal $_GET;\n\treturn exists($var_key, $_GET, $default_value);\n}",
"function get_variable()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_VARIABLE);\r\n }",
"public function getVariable(string $name): ?CachedVariable;",
"public function testGetExistingVar(): void\n {\n // setup\n $template = new HtmlTemplate(HtmlTemplateBaseTest::PATH_TO_TEST_DATA);\n $template->setPageVar('existing-var', 'existing value');\n\n // test body and assertions\n $this->assertEquals('existing value', $template->getPageVar('existing-var'));\n }",
"public function testGetUnexistingVar(): void\n {\n // setup\n $template = new HtmlTemplate(HtmlTemplateBaseTest::PATH_TO_TEST_DATA);\n\n // assertions\n $this->expectException(\\Exception::class);\n $this->expectExceptionCode(- 1);\n $this->expectExceptionMessage('Template variable unexisting-var was not set');\n\n // test body\n $template->getPageVar('unexisting-var');\n }",
"public function get(string $varName)\r\n {\r\n if (!array_key_exists($varName, $this->variables)) {\r\n return null;\r\n }\r\n return $this->variables[$varName];\r\n }",
"function getVariable($variableName)\r\n{\r\n if (isset($_GET[$variableName])) {\r\n $return = $_GET[$variableName];\r\n } elseif (isset($_POST[$variableName])) {\r\n $return = $_POST[$variableName];\r\n } else {\r\n return NULL;\r\n } \r\n\r\n return $return;\r\n}",
"public function getVariable()\n {\n if ($this->isCacheStale()) {\n $var = $this->loadVariableFromSource();\n $this->cacheVariable($var);\n } else {\n $var = $this->loadVariableFromCache();\n }\n return $var;\n }",
"function sbx_get_var( &$var, $default = null ) {\n\treturn isset( $var ) ? $var : $default;\n}",
"public function getVariable($key) {\n if (array_key_exists($key, $this->data)) return $this->data[$key];\n else return null;\n }",
"public static function _get(string $var) { return self::$get[$var] ?? null; }",
"public function getVariable($var) {\n\t\tif (!isset($this->variables[$var])) return null;\n\t\treturn $this->variables[$var];\n\t}",
"function the_variable($var) {\n\n\tif ( get_the_variable($var) ) {\n\t\techo $variable;\n\t}\n\n\treturn;\n\n}",
"function __isset($varname){\n return isset($this->templateVars[$varname]);\n }",
"public static function variable_get($name, $default = NULL) {\n return variable_get($name, $default);\n }",
"public function getVar($key) {\n\t\tif (isset($this->variables[$key])) {\n\t\t\treturn $this->variables[$key];\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public static function get($key){\n return isset(self::$vars[$key]) ? self::$vars[$key] : null;\n }",
"public function get($key) {\n return isset($this->templates[$key]) ? $this->templates[$key] : false;\n }",
"public function get_var()\n\t{\n return $this->get_one(func_get_args());\n }",
"public function __get($name = null){ \r\n\t\tif($name ===null) {\r\n\t\t\treturn $this->_tpl_vars;\r\n\t\t}\r\n\t\tif(isset($this->_tpl_vars[$name])){\r\n\t\t\treturn $this->_tpl_vars[$name];\r\n\t\t}\r\n\t\treturn '';\r\n\t}",
"public function get($key, $default = null) {\n $vars = $this->smarty->get_template_vars();\n $result = $default;\n\n if (isset($vars[$key])) {\n $result = $vars[$key];\n }\n\n return $result;\n }",
"public function getVariable($key)\n {\n return isset($this->variables[$key]) ? $this->variables[$key] : null;\n }",
"static function get($variable, $application = 'admin')\n {\n $instance = self :: get_instance();\n\n $params = & $instance->params;\n\n if (isset($params[$application]))\n {\n $value = $params[$application][$variable];\n return (isset($value) ? $value : null);\n }\n else\n {\n return null;\n }\n }",
"protected function getVar($var_name = 'dummy') {\n\t\treturn (isset($this->$var_name)) ? $this->$var_name: FALSE;\n\t}"
] | [
"0.6362235",
"0.6361442",
"0.63011307",
"0.60496634",
"0.59468204",
"0.594439",
"0.5921881",
"0.5851434",
"0.5839615",
"0.57585186",
"0.57518214",
"0.5734437",
"0.5731155",
"0.5727232",
"0.57178",
"0.5712768",
"0.5712512",
"0.5712508",
"0.5708865",
"0.5672098",
"0.56577784",
"0.5652777",
"0.5651376",
"0.56445074",
"0.5633817",
"0.5631938",
"0.55951893",
"0.5584945",
"0.55658764",
"0.5555719"
] | 0.68385136 | 0 |
Gets as carParkConfiguration The configuration/layout of a car park. | public function getCarParkConfiguration()
{
return $this->carParkConfiguration;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCarParkConfiguration($carParkConfiguration)\n {\n $this->carParkConfiguration = $carParkConfiguration;\n return $this;\n }",
"public function getCarParkStatus()\n {\n return $this->carParkStatus;\n }",
"public function getCarParkOccupancy()\n {\n return $this->carParkOccupancy;\n }",
"public function getCarParkIdentity()\n {\n return $this->carParkIdentity;\n }",
"public function cfg ( ) { return $this->cfg; }",
"public function getDriveWheelConfiguration() {\n\t\treturn $this->driveWheelConfiguration;\n\t}",
"public function getConfiguration() {\r\n return $this->configuration;\r\n }",
"public function getConfiguration()\n\t{\n\t\treturn $this->configuration;\n\t}",
"public function getConf()\n {\n return $this->pObj->conf;\n }",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration()\n {\n return $this->configuration;\n }",
"public function getConfiguration()\n {\n return $this->config;\n }",
"private function getLayout()\n {\n return $this->layout ?? config('kitukizuri.layout');\n }",
"public function getLayout()\n {\n return !empty($this->layout) ? $this->layout : config('pilot.default_layout');\n }",
"public function getCartsConfiguration()\n {\n return $this->cartsConfiguration instanceof CartsConfigurationBuilder ? $this->cartsConfiguration->build() : $this->cartsConfiguration;\n }",
"public function getConfiguration()\n {\n return $this->delegate->getConfiguration();\n }",
"public function getConfiguration()\n {\n $config = parent::getConfiguration();\n $config->setMpVisible($this->isActive());\n return $config;\n }",
"public function get_config() {\n\t\treturn $this->config_final;\n\t}",
"public function getAssessmentConfiguration()\n {\n return new Configuration(\n $this->getAllowHints(),\n $this->getShowScore(),\n $this->getShowCorrection(),\n $this->getShowSolution(),\n $this->getShowAnswerFeedback(),\n $this->getFeedbackLocation()\n );\n }",
"protected function _getImageSizeConfiguration()\n {\n return $this->_imageSizeConfiguration;\n }",
"protected function _getImageSizeConfiguration()\n {\n return $this->_imageSizeConfiguration;\n }",
"private function _get_config() {\n $cfg['groups'] = array(\"_sidebar\"=>t(\"Sidebar\"), \"_wholecloud\"=>t(\"Whole cloud\"));\n // this defines the separator that's used between the group name and the attribute, and is *not* put through t().\n $cfg['sep'] = \" : \";\n // this is used in the labels of the width/height parameters\n $cfg['size'] = array(\"_sidebar\"=>t(\"as fraction of sidebar width, e.g. 'g-block-content' class\"), \"_wholecloud\"=>t(\"as fraction of browser window height\"));\n return $cfg;\n }",
"public function getObjectConfiguration() {\n\t\treturn $this->objectConfiguration;\n\t}",
"public function getAllotmentConfig()\n {\n return isset($this->AllotmentConfig) ? $this->AllotmentConfig : null;\n }",
"public function getLayout()\n {\n return $this->config->get(static::PLUGIN_NAME . '.layout');\n }",
"public function getConfiguration();",
"public function getConfiguration();"
] | [
"0.6368013",
"0.6113661",
"0.5794351",
"0.56925875",
"0.553832",
"0.5377319",
"0.53404295",
"0.53312284",
"0.53199285",
"0.5297477",
"0.5297477",
"0.5297477",
"0.5297477",
"0.5297477",
"0.52963126",
"0.52801514",
"0.5271156",
"0.5225887",
"0.5117495",
"0.51106477",
"0.5106548",
"0.5089882",
"0.50871325",
"0.50871325",
"0.5085406",
"0.5084934",
"0.50756836",
"0.5064346",
"0.5057971",
"0.5057971"
] | 0.84681493 | 0 |
Sets a new carParkConfiguration The configuration/layout of a car park. | public function setCarParkConfiguration($carParkConfiguration)
{
$this->carParkConfiguration = $carParkConfiguration;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCarParkConfiguration()\n {\n return $this->carParkConfiguration;\n }",
"public function setCarParkIdentity($carParkIdentity)\n {\n $this->carParkIdentity = $carParkIdentity;\n return $this;\n }",
"public function setCarParkStatus($carParkStatus)\n {\n $this->carParkStatus = $carParkStatus;\n return $this;\n }",
"public function setParking(?Parking $parking): self\n {\n if ($parking === null && $this->parking !== null) {\n $this->parking->setSalle(null);\n }\n\n // set the owning side of the relation if necessary\n if ($parking !== null && $parking->getSalle() !== $this) {\n $parking->setSalle($this);\n }\n\n $this->parking = $parking;\n\n return $this;\n }",
"public function setCarParkOccupancy($carParkOccupancy)\n {\n $this->carParkOccupancy = $carParkOccupancy;\n return $this;\n }",
"public function configure(ProductPricingConfiguration $configuration)\n {\n $this->get('cost_price')->setCurrencyChoices($configuration->getCurrencyChoices());\n $this->get('sale_price')->setCurrencyChoices($configuration->getCurrencyChoices());\n }",
"public function setHasParkBrake($hasParkBrake): self\n {\n $this->hasParkBrake = $hasParkBrake;\n\n return $this;\n }",
"public function setConfiguration($configuration);",
"abstract public function setConfiguration($configuration);",
"public function setVehicleConfig($params);",
"public function setConfiguration($config) {\n $this->configuration = $config;\n }",
"public function setConfiguration($config) {\n $this->configuration = $config;\n }",
"public function getCarParkStatus()\n {\n return $this->carParkStatus;\n }",
"public function setConfig()\n {\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:0000000000000946 begin\n // section 10-10--91-60-7f09995f:12e75e0bc39:-8000:0000000000000946 end\n }",
"public function setConfiguration(array $configuration): self;",
"protected function setConfiguration( Configuration $config ) {\n\t\t$this->config = $config;\n\t}",
"public function configure()\n {\n $this->setOptions(array(\n 'video-library-encoder' => 'x264',\n 'video-quality' => '20',\n 'select-audio-tracks' => '1',\n 'audio-encoder' => 'faac',\n 'audio-bitrate' => '160',\n 'surround-sound-downmixing' => 'dp12',\n 'audio-samplerate' => 'Auto',\n 'dynamic-range-compression' => '0.0',\n 'format' => 'mp4',\n 'strict-anamorphic-pixel-aspect-ratio' => '',\n 'add-chapter-markers' => '',\n 'advanced-encoder-options' => 'ref=2:bframes=2:subme=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0',\n ));\n }",
"private function createNewForm(Carpark $carpark)\n {\n return $this->createForm('HVG\\SystemBundle\\Form\\CarparkType', $carpark, array(\n 'action' => $this->generateUrl('carpark_new'),\n ));\n }",
"public function showAction(Carpark $carpark)\n {\n $editForm = $this->createEditForm($carpark);\n $deleteForm = $this->createDeleteForm($carpark);\n\n return $this->render('carpark/show.html.twig', array(\n 'carpark' => $carpark,\n 'editForm' => $editForm->createView(),\n 'deleteForm' => $deleteForm->createView(),\n ));\n }",
"public function setConfiguration($configuration)\n {\n // store instance of configuration (for reading configuration)\n // @var $this->_configuration Apw_Configuration\n\t\t$this->_configuration = $configuration;\n }",
"abstract protected function newConfiguration();",
"public function setConfiguration(Configuration $configuration) {\n\t\t$this->configuration = $configuration;\n\t}",
"public function setConfig(array $configuration);",
"public function setPhpcsConfiguration(bool $configuration)\n {\n $this->phpcsConfiguration = $configuration;\n }",
"public function setConfiguration(array $configuration) {\n\t\t$this->templatePath = $configuration['templatePath'];\n\t\tTx_PtExtbase_Assertions_Assert::isNotEmptyString($this->templatePath, array('message' => 'No template path given for fluid export! 1284621481'));\n\t\t$this->setTemplatePathAndFilename(t3lib_div::getFileAbsFileName($this->templatePath));\n\n\t\t$this->paperSize = strtolower($configuration['paperSize']);\n\t\tTx_PtExtbase_Assertions_Assert::isNotEmptyString($this->paperSize, array('message' => 'No PaperSize given for the PDF output! 1322585559'));\n\n\t\t$this->paperOrientation = $configuration['paperOrientation'];\n\t\tTx_PtExtbase_Assertions_Assert::isInArray($this->paperOrientation, array('portrait', 'landscape'), array('message' => 'The Orientation must either be portrait or landscape! 1322585560'));\n\n\t\t$this->cssFilePath = t3lib_div::getFileAbsFileName($configuration['cssFilePath']);\n\t\tTx_PtExtbase_Assertions_Assert::isTrue(file_exists($this->cssFilePath), array('message' => 'The CSS File with the filename ' . $this->cssFilePath . ' can not be found. 1322587627'));\n\n\t\t$this->dompdfSourcePath = t3lib_div::getFileAbsFileName($configuration['dompdfSourcePath']);\n\t\tTx_PtExtbase_Assertions_Assert::isTrue(is_dir($this->dompdfSourcePath), array('message' => 'DomPdf source in path ' . $this->dompdfSourcePath . ' was not found. 1322753515'));\n\t\t$this->dompdfSourcePath = substr($this->dompdfSourcePath,-1,1) == '/' ? $this->dompdfSourcePath : $this->dompdfSourcePath . '/';\n\n\t\t$this->fileName = $configuration['fileName'];\n\t}",
"private function createEditForm(Carpark $carpark)\n {\n return $this->createForm('HVG\\SystemBundle\\Form\\CarparkType', $carpark, array(\n 'action' => $this->generateUrl('carpark_edit', array('id' => $carpark->getId())),\n ));\n }",
"public function getCarParkIdentity()\n {\n return $this->carParkIdentity;\n }",
"public function setConfiguration(CrawlConfigurationInterface $config)\n {\n $this->configuration = $config;\n }",
"public function editAction(Request $request, Carpark $carpark)\n {\n $editForm = $this->createEditForm($carpark);\n $deleteForm = $this->createDeleteForm($carpark);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted()) {\n if($editForm->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($carpark);\n $em->flush();\n $request->getSession()->getFlashBag()->add( 'success', 'carpark.flash.updated' );\n } else {\n return $this->render('carpark/edit.html.twig', array(\n 'carpark' => $carpark,\n 'editForm' => $editForm->createView(),\n 'deleteForm' => $deleteForm->createView(),\n ));\n }\n }\n\n return $this->redirect($this->generateUrl('carpark_index'));\n }",
"public function setDriveWheelConfiguration(Property\\DriveWheelConfiguration $driveWheelConfiguration) {\n\t\t$this->driveWheelConfiguration = $driveWheelConfiguration;\n\n\t\treturn $this;\n\t}"
] | [
"0.65391904",
"0.5995084",
"0.57981026",
"0.5731826",
"0.5341734",
"0.50243056",
"0.4969111",
"0.49219227",
"0.48193043",
"0.47299322",
"0.4665494",
"0.4665494",
"0.46313837",
"0.45986083",
"0.45892382",
"0.4563356",
"0.45619634",
"0.4538973",
"0.4537582",
"0.45252547",
"0.44979277",
"0.44808832",
"0.4468805",
"0.44444293",
"0.4427618",
"0.44101158",
"0.43955415",
"0.43875283",
"0.435666",
"0.43540582"
] | 0.72957623 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.